Go 解决"no buildable Go source file in"问题
【问题】 我有一个文件夹,文件夹名字叫 12 ,并且我创建了一个Go源文件 12_test.go,代码如下: package main import "fmt" func main() { fmt.Println("Hello world") } 运行下面命令时出了错: go build 12_test.go "go build command-line-arguments: no buildable Go source files in D:\12" 【解决】 _test后缀在Go语言中有着特殊含义,是用来给Go程序做测试的,build工具会忽略它们,它们会运行 go test。从文件名中删除_test,或者重命名就可以解决这个问题...阅读全文