基本上,在client.go中,我导入这样的包

pb "github.com/wilbyang/gotham-grpc/search"

当我尝试运行go run client.go时,出现错误:



我的gopath是:



而且我确定dir $GOPATH/src/github.com/wilbyang/gotham-grpc/search存在,并且在该dir search.pb.go存在下,由protoc和正在搜索的包生成。我真的不明白为什么要为此奋斗数小时!有人会带领我走出这一步吗?

最佳答案

go run client.go中存在main函数时,client.go起作用。

关于go - 说 'no buildable Go source files'的奇怪编译错误,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/42163748/

10-16 22:34