英文:
Golang import package error
问题
> go:5:2: 在任何地方都找不到包“github.com/googollee/go-socket.io”:
/usr/local/go/src/github.com/googollee/go-socket.io(来自$GOROOT)
/Users/YoungHoonKim/Documents/chat/src/github.com/googollee/go-socket.io(来自$GOPATH)
我在使用LiteIDE编译我的chat.go
文件时遇到了这个错误。我正在按照一个构建聊天服务器的指南进行操作,所以我不知道这个包应该在哪里。请帮忙解决一下?
英文:
> go:5:2: cannot find package "github.com/googollee/go-socket.io" in any of:
/usr/local/go/src/github.com/googollee/go-socket.io (from $GOROOT)
/Users/YoungHoonKim/Documents/chat/src/github.com/googollee/go-socket.io (from $GOPATH)
I'm getting this error while trying to compile my chat.go
file with LiteIDE. I'm following a guide to build a chatserver, so I don't know where this package should be. any help?
答案1
得分: 4
请在终端中使用echo $GOPATH
命令来确认你的实际工作目录。这将是你开始查找该包是否存在的起点,例如,你可以通过cd $GOPATH/src/github.com/googollee/go-socket.io
命令来查看该包。
关于正确的目录位置(通常是工作区)的更多详细信息,请参考https://golang.org/doc/code.html。
英文:
Double-check your actual go work directory with echo $GOPATH
in your terminal.
This will be your starting point to identify if you have this package at all, for example you should be able to see this package doing cd $GOPATH/src/github.com/googollee/go-socket.io
.
For more details on correct directory location (workspace in general) please check https://golang.org/doc/code.html
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论