关闭。这个问题是not reproducible or was caused by typos .它目前不接受答案。
想改进这个问题?将问题更新为 on-topic对于堆栈溢出。
2年前关闭。
Improve this question
我有一个使用 go 模块设置的项目,它看起来像:
module gitlab.com/ndland/ben_gym_app_back_end
go 1.13
require (
github.com/alicebob/gopher-json v0.0.0-20180125190556-5a6b3ba71ee6 // indirect
github.com/alicebob/miniredis v2.5.0+incompatible
github.com/go-chi/chi v4.0.3+incompatible
github.com/go-chi/render v1.0.1
github.com/gomodule/redigo v2.0.0+incompatible
github.com/gorilla/websocket v1.4.1
github.com/yuin/gopher-lua v0.0.0-20191220021717-ab39c6098bdb // indirect
)
我的一个 go 文件中有一个导入,上面写着
"gitlab.com/ndland/ben_gym_app_back_end/config"
该软件包存在,我在那里列出了一些 go 文件。从所有的角度来看,Goland (ide) 似乎对导入没有问题,但是,当我运行
go build
时或 go test
我得到以下信息:build gitlab.com/ndland/ben_gym_app_back_end/config: cannot load gitlab.com/ndland/ben_gym_app_back_end/config: no Go source files
关于为什么的任何想法?我对模块很陌生,但我认为我已经正确设置了它。
最佳答案
知道了,忘记传旗了-tags dev
我最初尝试过-tag=dev
无济于事。我的监督,但希望这对其他人有所帮助。
关于go - 为什么golang提示无法加载路径?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60356816/