gpt4 book ai didi

go.mod Unresolved 依赖

转载 作者:行者123 更新时间:2023-12-03 18:39:38 30 4
gpt4 key购买 nike

我正在使用 1.14.2 版本的 go。我正在尝试将我的项目添加到 go.mod 以使用 go mod init <dependecyname> 部署 heroku 。之后,我尝试使用 go run main.go 命令运行我的项目,但收到以下错误:

go: finding module for package github.com/googollee/go-socket.io
go: finding module for package github.com/dgrijalva/jwt-go
go: finding module for package github.com/gorilla/mux
go: found github.com/dgrijalva/jwt-go in github.com/dgrijalva/jwt-go v3.2.0+incompatible
go: found github.com/googollee/go-socket.io in github.com/googollee/go-socket.io v1.4.4
go: found github.com/gorilla/mux in github.com/gorilla/mux v1.8.0
controllers/userController.go:10:2: cannot find package
models/avatar.go:3:8: cannot find package
models/base.go:6:1: cannot find package
models/base.go:7:1: cannot find package
models/user.go:8:2: cannot find package
controllers/userController.go:11:2: cannot find package
controllers/userController.go:12:2: cannot find package
controllers/userController.go:13:2: cannot find package
而且当我调查我的 go.mod 文件时,我意识到 require 块中有 Unresolved 依赖错误:
module <modulename>

go 1.14

require (
github.com/dgrijalva/jwt-go v3.2.0+incompatible // indirect
github.com/googollee/go-socket.io v1.4.4 // indirect
github.com/gorilla/mux v1.8.0 // indirect
)
如何解决?

最佳答案

我遇到了类似的问题,我能够通过启用 go modules 集成来解决。您可以从 Preferences > GO > GO Modules 执行此操作。

关于go.mod Unresolved 依赖,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64463967/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com