Golang 解决"no buildable Go source file in"问题
2017-07-19 16:43
671 查看
问题】
我有一个文件夹,文件夹名字叫 12 ,并且我创建了一个Go源文件 12_test.go,代码如下:
运行下面命令时出了错:
【解决】
_test后缀在Go语言中有着特殊含义,是用来给Go程序做测试的,build工具会忽略它们。从文件名中删除_test,或者重命名就可以解决这个问题。
原文地址:http://stackoverflow.com/questions/29136488/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工具会忽略它们。从文件名中删除_test,或者重命名就可以解决这个问题。
原文地址:http://stackoverflow.com/questions/29136488/go-no-buildable-go-source-file-in
相关文章推荐
- [解决问题][不能更新eclipse]错误提示:Error retrieving "feature.xml". [error in opening zip file]
- 今天又学了一招,牛逼!!!解决"-bash:No such file or directory"问题
- python问题Non-ASCII character '\xe5' in file Apriori.py on line 1, but no encoding declared 解决办法
- python问题Non-ASCII character '\xe5' in file Apriori.py on line 1, but no encoding declared 解决办法
- error: #5: cannot open source input file "stm32f10x_conf.h": No such fi 解决方法
- CUDA 问题解决 —— CUDA+MPI出错:"mpi.h" No such file or directory
- 解决有关"Source File: c:/windows/microsoft.net/framework/v1.1.4322/Config/machine.config Line: 198"错误的问题
- 解决nginx重启“var/run/nginx/nginx.pid" no such file or directory问题
- [已解决]关于python无法显示中文的问题:SyntaxError: Non-ASCII character '\xe4' in file test.py on line 3, but no encoding declared。
- Plug-in "net.sourceforge.jode" was unable to instantiate 问题解决
- Eclipse中编译和运行时使用的JDK和JRE级别问题(关于"Bad version number in .class file"的异常解决)
- R语言-Error in file(out, "wt") : 无法打开链结问题解决
- python问题Non-ASCII character '\xe5' in file Apriori.py on line 1, but no encoding declared 解决办法
- [已解决]关于python无法显示中文的问题:SyntaxError: Non-ASCII character '\xe4' in file test.py on line 3, but no enc
- 解决安装nginx的nginx: [emerg] mkdir() "/var/temp/nginx/client" failed (2: No such file or directory)问题
- CentOS下gdb升级(解决No symbol "***" in current context问题)
- 解决eclipse查看源代码出现The jar file rt.jar has no source attachment问题的方法
- 解决nginx重启“var/run/nginx/nginx.pid" no such file or directory问题
- VScode-Go can't load package: package .: no buildable Go source files in