为什么我在尝试下载go软件包时总是收到此消息?

为什么我在尝试下载go软件包时总是收到此消息?,go,caching,go-get,go-fiber,Go,Caching,Go Get,Go Fiber,如何下载软件包?我相信它正在尝试检查我的计算机上缓存的内容,我不知道如何首先下载它。因为您尚未启动模块,您应该使用go mod init YourModuleName,这样做非常简单。同时从go-get命令中删除-f。“我不知道如何先下载它”--请尝试不使用-u和-f。这是因为/v2尾部。您应该按照说明,首先运行go mod init,以正确初始化项目,以便与模块一起使用。看见 C:\Users\Administrator\Documents\code\projects\weatherly>

如何下载软件包?我相信它正在尝试检查我的计算机上缓存的内容,我不知道如何首先下载它。

因为您尚未启动模块,您应该使用
go mod init YourModuleName
,这样做非常简单。同时从go-get命令中删除-f。

“我不知道如何先下载它”--请尝试不使用
-u
-f
。这是因为
/v2
尾部。您应该按照说明,首先运行
go mod init
,以正确初始化项目,以便与模块一起使用。看见
C:\Users\Administrator\Documents\code\projects\weatherly>go get -u github.com/gofiber/fiber/v2 
cannot find package "github.com/gofiber/fiber/v2" in any of:
        c:\go\src\github.com\gofiber\fiber\v2 (from $GOROOT)
        C:\Users\Administrator\go\src\github.com\gofiber\fiber\v2 (from $GOPATH)