基本上,在 client.go 中我导入了这样一个包
pb "github.com/wilbyang/gotham-grpc/search"
当我尝试运行 go run client.go 时,出现错误:
no buildable Go source files in /Users/wilbyang/goPath/src/github.com/wilbyang/gotham-grpc/search".
我的路径是:
"/Users/wilbyang/goPath/".
而且我确定目录 $GOPATH/src/github.com/wilbyang/gotham-grpc/search
存在并且在该目录下 search.pb.go
存在,由 protoc 和正在搜索的包生成。我真的不明白为什么并为此苦苦挣扎了几个小时!有谁能引导我摆脱困境吗?
最佳答案
go run client.go
在 client.go
中有一个 main
函数时工作。
关于go - 奇怪的编译错误说 'no buildable Go source files',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42163748/