Golang导入包错误

huangapple go评论77阅读模式
英文:

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

huangapple
  • 本文由 发表于 2016年12月17日 02:04:03
  • 转载请务必保留本文链接:https://go.coder-hub.com/41190032.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定