无法加载软件包:软件包:无法建立Go源文件 [英] can't load package: package .: no buildable Go source files
问题描述
以下是错误消息:
%go获取
无法加载包:package。:no / Users / 7yan00
$ echo $ GOPATH
/ Users / 7yan00 / Golang
$可建立的Go源文件b
$ b
你会如何解决这个错误?
确保你在使用那个命令Go项目源文件夹(例如 / Users / 7yan00 / Golang / src / myProject
)。
类似于这个bug)是使用 -d
选项(请参阅 go get
命令)
go get -d
-d
标志指示在下载包后停止;也就是说,它指示不安装软件包。
查看这是否对您有帮助。
但更一般地说,如:
< blockquote>
go get
用于包,不用于存储库。所以如果你想要一个特定的包,比如 go.text / encoding
,那么使用
去获取code.google.com/p/go.text/encoding
如果您需要该存储库中的所有包,请使用
...
来表示:
去获取code.google.com/p/go.text / ...
Here is the error message:
% go get
can't load package: package .: no buildable Go source files in /Users/7yan00
% echo $GOPATH
/Users/7yan00/Golang
How would you troubleshoot that error?
Make sure you are using that command in the Go project source folder (like /Users/7yan00/Golang/src/myProject
).
One alternative (similar to this bug) is to use the -d
option (see go get
command)
go get -d
The
-d
flag instructs get to stop after downloading the packages; that is, it instructs get not to install the packages.
See if that helps in your case.
But more generally, as described in this thread:
go get
is for package(s), not for repositories.so if you want a specific package, say,
go.text/encoding
, then use
go get code.google.com/p/go.text/encoding
if you want all packages in that repository, use
...
to signify that:
go get code.google.com/p/go.text/...
这篇关于无法加载软件包:软件包:无法建立Go源文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!