dougu2240
2018-11-02 13:12
浏览 1.3k

如何避免找不到包“ github.com/golang/protobuf/jsonpb”错误

I want to put my code inside a docker container, I have created dockerfile and when I run, I got an error

internal/server/handlers.go:16:2: cannot find package "github.com/lib/pq" in any of:
    /usr/local/go/src/github.com/lib/pq (from $GOROOT)
    /go/src/github.com/lib/pq (from $GOPATH)

but when I launch my code locally without docker by typing go run main.go everything is fine

图片转代码服务由CSDN问答提供 功能建议

我想将代码放入docker容器中,我创建了dockerfile,当我运行时,出现错误

  internal / server / handlers.go:16:2:在以下任何位置都找不到软件包“ github.com/lib/pq”:
 / usr / local / go  /src/github.com/lib/pq(来自$ GOROOT)
 /go/src/github.com/lib/pq(来自$ GOPATH)
   
 
 

但是当我通过键入go run main.go在没有docker的情况下在本地启动代码时,一切都很好

  • 写回答
  • 好问题 提建议
  • 追加酬金
  • 关注问题
  • 邀请回答

1条回答 默认 最新

相关推荐 更多相似问题