Golang导入包错误 [英] Golang import package error

查看:73
本文介绍了Golang导入包错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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)

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)

我在尝试使用LiteIDE编译 chat.go 文件时遇到此错误.我正在遵循构建聊天服务器的指南,所以我不知道该程序包应该在哪里.有帮助吗?

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?

推荐答案

在终端中使用 echo $ GOPATH 仔细检查您的实际go工作目录.这将是您确定是否完全拥有此软件包的起点,例如,您应该能够看到此软件包正在执行 cd $ GOPATH/src/github.com/googollee/go-socket.io .

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.

有关正确目录位置(一般为工作区)的更多详细信息,请检查 https://golang.org/doc/code.html

For more details on correct directory location (workspace in general) please check https://golang.org/doc/code.html

这篇关于Golang导入包错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆