dpg2905 2018-11-15 16:14
浏览 42
已采纳

如果go模块坏了怎么办

As Node.js developer I am still new to Golang and struggling with the dependency management in Go. I am using Go 1.11 and applied mod init after importing all my dependencies. One of them is logrus which prevents me from compiling my go application.

The problem:

I believe that the problem is indeed inside of logrus, however I don't know how I could now get another (working) version of logrus, so that I can compile my application again.

/Users/redacted/Documents/redacted3/redacted2>Finished running tool: /usr/local/bin/go vet ./...
/Users/redacted/go/pkg/mod/github.com/sirupsen/logrus@v1.2.0/entry.go:51: undefined: Logger
/Users/redacted/go/pkg/mod/github.com/sirupsen/logrus@v1.2.0/entry.go:54: undefined: Fields
/Users/redacted/go/pkg/mod/github.com/sirupsen/logrus@v1.2.0/entry.go:61: undefined: Level

How can I get rid of these annoying kind of dependency issues?

Relevant import:

log "github.com/sirupsen/logrus"

Go.mod contains

github.com/sirupsen/logrus v1.2.0
  • 写回答

2条回答 默认 最新

  • doubi2145 2018-11-16 09:25
    关注

    I had to delete the module in my /go/pkg/mod/github.com/... path which fixed the issue. Appparently something gone wrong while creating the module or initially pulling the code from github.

    Afterwards I go get my logrus lib again and it worked as intended.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 2020长安杯与连接网探
  • ¥15 关于#matlab#的问题:在模糊控制器中选出线路信息,在simulink中根据线路信息生成速度时间目标曲线(初速度为20m/s,15秒后减为0的速度时间图像)我想问线路信息是什么
  • ¥15 banner广告展示设置多少时间不怎么会消耗用户价值
  • ¥16 mybatis的代理对象无法通过@Autowired装填
  • ¥15 可见光定位matlab仿真
  • ¥15 arduino 四自由度机械臂
  • ¥15 wordpress 产品图片 GIF 没法显示
  • ¥15 求三国群英传pl国战时间的修改方法
  • ¥15 matlab代码代写,需写出详细代码,代价私
  • ¥15 ROS系统搭建请教(跨境电商用途)