亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

如何安裝子命令?

如何安裝子命令?

Go
躍然一笑 2022-08-09 16:16:54
我在 Go v. 1.15.8 darwin/amd64 中收到以下錯誤消息main.go:8:2: cannot find package "github.com/google/subcommands" in any of:/usr/local/go/src/github.com/google/subcommands (from $GOROOT)/Users/user1/go/src/github.com/google/subcommands (from $GOPATH)main.go 中的代碼如下所示:package mainimport (        "flag"        "context"        "os"        "github.com/google/subcommands")我知道子命令位于這里:https://github.com/google/subcommands 與git存儲庫在這里:https://github.com/google/subcommands.git但是我該如何安裝它呢?當我這樣做時:go get github.com/google/subcommands我收到以下錯誤消息:# cd .; git clone -- https://github.com/google/subcommands /Users/user1/go/src/github.com/google/subcommandsCloning into '/Users/user1/go/src/github.com/google/subcommands'...fatal: unable to access 'https://github.com/google/subcommands/': Could not resolve host: github.compackage github.com/google/subcommands: exit status 128當我打開我的Web瀏覽器并轉到:https://github.com/google/subcommands/ 我可以看到網頁沒有問題。那么,為什么“go get”命令會遇到問題呢?我做錯了什么?
查看完整描述

1 回答

?
守候你守候我

TA貢獻1802條經驗 獲得超10個贊

除了 git 配置之外,您還可以檢查環境變量HTTP_PROXY/HTTPS_PROXY

但更重要的是,檢查添加是否會有所幫助(還有其他Go模塊代理)GOPROXY=https://proxy.golang.org)

這可以幫助從任何提供商,GitHub或其他提供商獲取模塊。


查看完整回答
反對 回復 2022-08-09
  • 1 回答
  • 0 關注
  • 124 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號