Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

问题:vscode 远程开发,goproxy 怎么配置? #179

Open
lygn128 opened this issue Jun 25, 2023 · 12 comments
Open

问题:vscode 远程开发,goproxy 怎么配置? #179

lygn128 opened this issue Jun 25, 2023 · 12 comments

Comments

@lygn128
Copy link

lygn128 commented Jun 25, 2023

已经在 ~/.bashrc 中配置了环境变量 export GOPROXY=https://goproxy.cn,direct
Tools environment: GOPATH=undefined
Installing 1 tool at undefined in module mode.
go-outline

Installing golang.org/x/tools/gopls@latest FAILED
{
"code": 1,
"killed": false,
"signal": null,
"cmd": "/home/ldy/go/bin/go install -v golang.org/x/tools/gopls@latest",
"stdout": "",
"stderr": "go: golang.org/x/tools/gopls@latest: module golang.org/x/tools/gopls: Get "https://proxy.golang.org/golang.org/x/tools/gopls/@v/list\": dial tcp 172.217.163.49:443: i/o timeout\n"
}

1 tools failed to install.

gopls: failed to install gopls(golang.org/x/tools/gopls@latest): Error: Command failed: /home/ldy/go/bin/go install -v golang.org/x/tools/gopls@latest
go: golang.org/x/tools/gopls@latest: module golang.org/x/tools/gopls: Get "https://proxy.golang.org/golang.org/x/tools/gopls/@v/list": dial tcp 172.217.163.49:443: i/o timeout

Installing github.com/ramya-rao-a/[email protected] FAILED
{
"code": 1,
"killed": false,
"signal": null,
"cmd": "/home/ldy/go/bin/go install -v github.com/ramya-rao-a/[email protected]",
"stdout": "",
"stderr": "go: github.com/ramya-rao-a/[email protected]: github.com/ramya-rao-a/[email protected]: Get "https://proxy.golang.org/github.com/ramya-rao-a/go-outline/@v/v0.0.0-20210608161538-9736a4bde949.info\": dial tcp 172.217.163.49:443: i/o timeout\n"
}

1 tools failed to install.

go-outline: failed to install go-outline(github.com/ramya-rao-a/[email protected]): Error: Command failed: /home/ldy/go/bin/go install -v github.com/ramya-rao-a/[email protected]
go: github.com/ramya-rao-a/[email protected]: github.com/ramya-rao-a/[email protected]: Get "https://proxy.golang.org/github.com/ramya-rao-a/go-outline/@v/v0.0.0-20210608161538-9736a4bde949.info": dial tcp 172.217.163.49:443: i/o timeout

当你执行 go version 命令后的输出结果是什么?

$ go version
go version go1.20.5 linux/amd64

当你执行 go env 命令后的输出结果是什么?

go env 的输出结果
$ go env

GO111MODULE="on"
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/ldy/.cache/go-build"
GOENV="/home/ldy/.config/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE=""
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH=""
GOPRIVATE=""
GOPROXY="https://goproxy.cn,direct"
GOROOT="/home/ldy/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/home/ldy/go/pkg/tool/linux_amd64"
GOVCS=""
GOVERSION="go1.20.5"
GCCGO="gccgo"
GOAMD64="v1"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/home/ldy/code/cubefs/go.mod"
GOWORK=""
CGO_CFLAGS="-O2 -g"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-O2 -g"
CGO_FFLAGS="-O2 -g"
CGO_LDFLAGS="-O2 -g"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -Wl,--no-gc-sections -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build1072853105=/tmp/go-build -gno-record-gcc-switches"

你做了什么?

你期望看到的结果是什么?

你实际看到的结果是什么?

@aofei
Copy link
Member

aofei commented Jun 25, 2023

远程开发自然是要将环境变量配置到远程机器上了。你是怎么远程开发的?用的 Visual Studio Code Server 吗?

@lygn128
Copy link
Author

lygn128 commented Jun 25, 2023

是的,但是gopls 依然是 i/o timeout

@lygn128
Copy link
Author

lygn128 commented Jun 25, 2023

远程开发自然是要将环境变量配置到远程机器上了。你是怎么远程开发的?用的 Visual Studio Code Server 吗?

是的,该配置的都配置了,但是 go 扩展安装 gopls 等tools 时候依然是 i/o time out

@wxybear
Copy link

wxybear commented Jul 28, 2023

go env -w GOPROXY=https://goproxy.cn,direct 下可以吗

@eiguleo
Copy link

eiguleo commented Oct 20, 2023

代理在远程机器上正常配置就可以, 和vscode远程开发没有关系

@hailaz
Copy link

hailaz commented Oct 20, 2023

go env -w GOPROXY=https://goproxy.cn,direct 下可以吗

远程上去后,先go env看看当前的环境情况。
然后就是如他所说的执行go env -w 设置。感觉要注意一下当前用户和remote-ssh的用户问题

@digbangbang
Copy link

Installing 7 tools at /home/lizhiwei/go/bin in module mode.
gotests
gomodifytags
impl
goplay
dlv
staticcheck
gopls

Installing github.com/cweill/gotests/[email protected] FAILED
{
"code": 1,
"killed": false,
"signal": null,
"cmd": "/usr/local/go/bin/go get -x github.com/cweill/gotests/[email protected]",
"stdout": "",
"stderr": "go: finding github.com v1.6.0\ngo: finding github.com/cweill/gotests/gotests v1.6.0\n# get https://goproxy.io/github.com/cweill/gotests/gotests/@v/v1.6.0.info\n# get https://goproxy.io/github.com/@v/v1.6.0.info\ngo: finding github.com/cweill v1.6.0\n# get https://goproxy.io/github.com/cweill/@v/v1.6.0.info\n# get https://goproxy.io/sumdb/gosum.io/supported\n# get https://goproxy.io/sumdb/gosum.io/supported: 200 OK (0.773s)\n# get https://goproxy.io/sumdb/gosum.io/lookup/github.com/cweill/[email protected]\n# get https://goproxy.io/github.com/cweill/@v/v1.6.0.info: 404 Not Found (1.037s)\n# get https://goproxy.io/sumdb/gosum.io/lookup/github.com/cweill/[email protected]: 404 Not Found (0.553s)\nverifying github.com/cweill/[email protected]: github.com/cweill/[email protected]: reading https://goproxy.io/sumdb/gosum.io/lookup/github.com/cweill/[email protected]: 404 Not Found\n"
}
Installing github.com/fatih/[email protected] FAILED
{
"code": 1,
"killed": false,
"signal": null,
"cmd": "/usr/local/go/bin/go get -x github.com/fatih/[email protected]",
"stdout": "",
"stderr": "go: finding github.com v1.16.0\n# get https://goproxy.io/github.com/@v/v1.16.0.info\ngo: finding github.com/fatih v1.16.0\n# get https://goproxy.io/github.com/fatih/@v/v1.16.0.info\n# get https://goproxy.io/sumdb/gosum.io/supported\n# get https://goproxy.io/sumdb/gosum.io/supported: 200 OK (0.834s)\n# get https://goproxy.io/sumdb/gosum.io/lookup/github.com/fatih/[email protected]\n# get https://goproxy.io/github.com/@v/v1.16.0.info: 404 Not Found (1.757s)\n# get https://goproxy.io/github.com/fatih/@v/v1.16.0.info: 404 Not Found (1.757s)\n# get https://goproxy.io/sumdb/gosum.io/lookup/github.com/fatih/[email protected]: 404 Not Found (1.201s)\nverifying github.com/fatih/[email protected]: github.com/fatih/[email protected]: reading https://goproxy.io/sumdb/gosum.io/lookup/github.com/fatih/[email protected]: 404 Not Found\n"
}
Installing github.com/josharian/[email protected] FAILED
{
"code": 1,
"killed": false,
"signal": null,
"cmd": "/usr/local/go/bin/go get -x github.com/josharian/[email protected]",
"stdout": "",
"stderr": "go: finding github.com v1.1.0\n# get https://goproxy.io/github.com/@v/v1.1.0.info\n# get https://goproxy.io/sumdb/gosum.io/supported\ngo: finding github.com/josharian v1.1.0\n# get https://goproxy.io/github.com/josharian/@v/v1.1.0.info\n# get https://goproxy.io/sumdb/gosum.io/supported: 200 OK (0.815s)\n# get https://goproxy.io/sumdb/gosum.io/lookup/github.com/josharian/[email protected]\n# get https://goproxy.io/sumdb/gosum.io/lookup/github.com/josharian/[email protected]: 404 Not Found (0.595s)\nverifying github.com/josharian/[email protected]: github.com/josharian/[email protected]: reading https://goproxy.io/sumdb/gosum.io/lookup/github.com/josharian/[email protected]: 404 Not Found\n"
}
Installing github.com/haya14busa/goplay/cmd/[email protected] FAILED
{
"code": 1,
"killed": false,
"signal": null,
"cmd": "/usr/local/go/bin/go get -x github.com/haya14busa/goplay/cmd/[email protected]",
"stdout": "",
"stderr": "go: finding github.com v1.0.0\n# get https://goproxy.io/github.com/@v/v1.0.0.info\ngo: finding github.com/haya14busa/goplay/cmd/goplay v1.0.0\n# get https://goproxy.io/github.com/haya14busa/goplay/cmd/goplay/@v/v1.0.0.info\ngo: finding github.com/haya14busa/goplay/cmd v1.0.0\n# get https://goproxy.io/github.com/haya14busa/goplay/cmd/@v/v1.0.0.info\ngo: finding github.com/haya14busa v1.0.0\n# get https://goproxy.io/github.com/haya14busa/@v/v1.0.0.info\n# get https://goproxy.io/sumdb/gosum.io/supported\n# get https://goproxy.io/sumdb/gosum.io/supported: 200 OK (0.795s)\n# get https://goproxy.io/sumdb/gosum.io/lookup/github.com/haya14busa/[email protected]\n# get https://goproxy.io/github.com/haya14busa/@v/v1.0.0.info: 404 Not Found (1.041s)\n# get https://goproxy.io/sumdb/gosum.io/lookup/github.com/haya14busa/[email protected]: 404 Not Found (0.539s)\nverifying github.com/haya14busa/[email protected]: github.com/haya14busa/[email protected]: reading https://goproxy.io/sumdb/gosum.io/lookup/github.com/haya14busa/[email protected]: 404 Not Found\n"
}
Installing github.com/go-delve/delve/cmd/dlv@latest FAILED
{
"code": 1,
"killed": false,
"signal": null,
"cmd": "/usr/local/go/bin/go get -x github.com/go-delve/delve/cmd/dlv@latest",
"stdout": "",
"stderr": "# get https://goproxy.io/github.com/go-delve/delve/@v/list\n# get https://goproxy.io/github.com/go-delve/delve/cmd/@v/list\n# get https://goproxy.io/github.com/@v/list\n# get https://goproxy.io/github.com/go-delve/@v/list\n# get https://goproxy.io/github.com/go-delve/delve/cmd/dlv/@v/list\n# get https://goproxy.io/github.com/@v/list: 404 Not Found (0.776s)\n# get https://goproxy.io/github.com/go-delve/@v/list: 404 Not Found (1.029s)\n# get https://goproxy.io/github.com/go-delve/delve/@v/list: 200 OK (1.724s)\n# get https://goproxy.io/sumdb/gosum.io/supported\n# get https://goproxy.io/github.com/go-delve/delve/cmd/dlv/@v/list: 404 Not Found (1.729s)\n# get https://goproxy.io/github.com/go-delve/delve/cmd/@v/list: 404 Not Found (1.761s)\n# get https://goproxy.io/sumdb/gosum.io/supported: 200 OK (0.259s)\n# get https://goproxy.io/sumdb/gosum.io/lookup/github.com/go-delve/[email protected]\n# get https://goproxy.io/sumdb/gosum.io/lookup/github.com/go-delve/[email protected]: 404 Not Found (1.202s)\nverifying github.com/go-delve/[email protected]: github.com/go-delve/[email protected]: reading https://goproxy.io/sumdb/gosum.io/lookup/github.com/go-delve/[email protected]: 404 Not Found\n"
}
Installing honnef.co/go/tools/cmd/[email protected] FAILED
{
"code": 1,
"killed": false,
"signal": null,
"cmd": "/usr/local/go/bin/go get -x honnef.co/go/tools/cmd/[email protected]",
"stdout": "",
"stderr": "go: finding honnef.co v0.2.2\n# get https://goproxy.io/honnef.co/@v/v0.2.2.info\ngo: finding honnef.co/go/tools/cmd v0.2.2\n# get https://goproxy.io/honnef.co/go/tools/cmd/@v/v0.2.2.info\ngo: finding honnef.co/go/tools/cmd/staticcheck v0.2.2\n# get https://goproxy.io/honnef.co/go/tools/cmd/staticcheck/@v/v0.2.2.info\ngo: finding honnef.co/go v0.2.2\n# get https://goproxy.io/honnef.co/go/@v/v0.2.2.info\n# get https://goproxy.io/sumdb/gosum.io/supported\n# get https://goproxy.io/sumdb/gosum.io/supported: 200 OK (0.803s)\n# get https://goproxy.io/sumdb/gosum.io/lookup/honnef.co/go/[email protected]\n# get https://goproxy.io/sumdb/gosum.io/lookup/honnef.co/go/[email protected]: 404 Not Found (1.201s)\nverifying honnef.co/go/[email protected]: honnef.co/go/[email protected]: reading https://goproxy.io/sumdb/gosum.io/lookup/honnef.co/go/[email protected]: 404 Not Found\n"
}
Installing golang.org/x/tools/gopls@latest FAILED
{
"code": 1,
"killed": false,
"signal": null,
"cmd": "/usr/local/go/bin/go get -x golang.org/x/tools/gopls@latest",
"stdout": "",
"stderr": "# get https://goproxy.io/golang.org/@v/list\n# get https://goproxy.io/golang.org/x/tools/gopls/@v/list\n# get https://goproxy.io/golang.org/x/tools/@v/list\n# get https://goproxy.io/golang.org/x/@v/list\n# get https://goproxy.io/golang.org/x/tools/@v/list: 200 OK (1.078s)\n# get https://goproxy.io/golang.org/@v/list: 404 Not Found (1.078s)\n# get https://goproxy.io/golang.org/x/tools/gopls/@v/list: 200 OK (1.078s)\n# get https://goproxy.io/sumdb/gosum.io/supported\n# get https://goproxy.io/sumdb/gosum.io/supported: 200 OK (0.257s)\n# get https://goproxy.io/sumdb/gosum.io/lookup/golang.org/x/[email protected]\n# get https://goproxy.io/sumdb/gosum.io/lookup/golang.org/x/tools/[email protected]\n# get https://goproxy.io/golang.org/x/@v/list: 404 Not Found (1.818s)\n# get https://goproxy.io/sumdb/gosum.io/lookup/golang.org/x/tools/[email protected]: 404 Not Found (0.543s)\nverifying golang.org/x/tools/[email protected]: golang.org/x/tools/[email protected]: reading https://goproxy.io/sumdb/gosum.io/lookup/golang.org/x/tools/[email protected]: 404 Not Found\n"
}

7 tools failed to install.

gotests: failed to install gotests(github.com/cweill/gotests/[email protected]): Error: Command failed: /usr/local/go/bin/go get -x github.com/cweill/gotests/[email protected]
go: finding github.com v1.6.0
go: finding github.com/cweill/gotests/gotests v1.6.0

get https://goproxy.io/github.com/cweill/gotests/gotests/@v/v1.6.0.info

get https://goproxy.io/github.com/@v/v1.6.0.info

go: finding github.com/cweill v1.6.0

get https://goproxy.io/github.com/cweill/@v/v1.6.0.info

get https://goproxy.io/sumdb/gosum.io/supported

get https://goproxy.io/sumdb/gosum.io/supported: 200 OK (0.773s)

get https://goproxy.io/sumdb/gosum.io/lookup/github.com/cweill/[email protected]

get https://goproxy.io/github.com/cweill/@v/v1.6.0.info: 404 Not Found (1.037s)

get https://goproxy.io/sumdb/gosum.io/lookup/github.com/cweill/[email protected]: 404 Not Found (0.553s)

verifying github.com/cweill/[email protected]: github.com/cweill/[email protected]: reading https://goproxy.io/sumdb/gosum.io/lookup/github.com/cweill/[email protected]: 404 Not Found

gomodifytags: failed to install gomodifytags(github.com/fatih/[email protected]): Error: Command failed: /usr/local/go/bin/go get -x github.com/fatih/[email protected]
go: finding github.com v1.16.0

get https://goproxy.io/github.com/@v/v1.16.0.info

go: finding github.com/fatih v1.16.0

get https://goproxy.io/github.com/fatih/@v/v1.16.0.info

get https://goproxy.io/sumdb/gosum.io/supported

get https://goproxy.io/sumdb/gosum.io/supported: 200 OK (0.834s)

get https://goproxy.io/sumdb/gosum.io/lookup/github.com/fatih/[email protected]

get https://goproxy.io/github.com/@v/v1.16.0.info: 404 Not Found (1.757s)

get https://goproxy.io/github.com/fatih/@v/v1.16.0.info: 404 Not Found (1.757s)

get https://goproxy.io/sumdb/gosum.io/lookup/github.com/fatih/[email protected]: 404 Not Found (1.201s)

verifying github.com/fatih/[email protected]: github.com/fatih/[email protected]: reading https://goproxy.io/sumdb/gosum.io/lookup/github.com/fatih/[email protected]: 404 Not Found

impl: failed to install impl(github.com/josharian/[email protected]): Error: Command failed: /usr/local/go/bin/go get -x github.com/josharian/[email protected]
go: finding github.com v1.1.0

get https://goproxy.io/github.com/@v/v1.1.0.info

get https://goproxy.io/sumdb/gosum.io/supported

go: finding github.com/josharian v1.1.0

get https://goproxy.io/github.com/josharian/@v/v1.1.0.info

get https://goproxy.io/sumdb/gosum.io/supported: 200 OK (0.815s)

get https://goproxy.io/sumdb/gosum.io/lookup/github.com/josharian/[email protected]

get https://goproxy.io/sumdb/gosum.io/lookup/github.com/josharian/[email protected]: 404 Not Found (0.595s)

verifying github.com/josharian/[email protected]: github.com/josharian/[email protected]: reading https://goproxy.io/sumdb/gosum.io/lookup/github.com/josharian/[email protected]: 404 Not Found

goplay: failed to install goplay(github.com/haya14busa/goplay/cmd/[email protected]): Error: Command failed: /usr/local/go/bin/go get -x github.com/haya14busa/goplay/cmd/[email protected]
go: finding github.com v1.0.0

get https://goproxy.io/github.com/@v/v1.0.0.info

go: finding github.com/haya14busa/goplay/cmd/goplay v1.0.0

get https://goproxy.io/github.com/haya14busa/goplay/cmd/goplay/@v/v1.0.0.info

go: finding github.com/haya14busa/goplay/cmd v1.0.0

get https://goproxy.io/github.com/haya14busa/goplay/cmd/@v/v1.0.0.info

go: finding github.com/haya14busa v1.0.0

get https://goproxy.io/github.com/haya14busa/@v/v1.0.0.info

get https://goproxy.io/sumdb/gosum.io/supported

get https://goproxy.io/sumdb/gosum.io/supported: 200 OK (0.795s)

get https://goproxy.io/sumdb/gosum.io/lookup/github.com/haya14busa/[email protected]

get https://goproxy.io/github.com/haya14busa/@v/v1.0.0.info: 404 Not Found (1.041s)

get https://goproxy.io/sumdb/gosum.io/lookup/github.com/haya14busa/[email protected]: 404 Not Found (0.539s)

verifying github.com/haya14busa/[email protected]: github.com/haya14busa/[email protected]: reading https://goproxy.io/sumdb/gosum.io/lookup/github.com/haya14busa/[email protected]: 404 Not Found

dlv: failed to install dlv(github.com/go-delve/delve/cmd/dlv@latest): Error: Command failed: /usr/local/go/bin/go get -x github.com/go-delve/delve/cmd/dlv@latest

get https://goproxy.io/github.com/go-delve/delve/@v/list

get https://goproxy.io/github.com/go-delve/delve/cmd/@v/list

get https://goproxy.io/github.com/@v/list

get https://goproxy.io/github.com/go-delve/@v/list

get https://goproxy.io/github.com/go-delve/delve/cmd/dlv/@v/list

get https://goproxy.io/github.com/@v/list: 404 Not Found (0.776s)

get https://goproxy.io/github.com/go-delve/@v/list: 404 Not Found (1.029s)

get https://goproxy.io/github.com/go-delve/delve/@v/list: 200 OK (1.724s)

get https://goproxy.io/sumdb/gosum.io/supported

get https://goproxy.io/github.com/go-delve/delve/cmd/dlv/@v/list: 404 Not Found (1.729s)

get https://goproxy.io/github.com/go-delve/delve/cmd/@v/list: 404 Not Found (1.761s)

get https://goproxy.io/sumdb/gosum.io/supported: 200 OK (0.259s)

get https://goproxy.io/sumdb/gosum.io/lookup/github.com/go-delve/[email protected]

get https://goproxy.io/sumdb/gosum.io/lookup/github.com/go-delve/[email protected]: 404 Not Found (1.202s)

verifying github.com/go-delve/[email protected]: github.com/go-delve/[email protected]: reading https://goproxy.io/sumdb/gosum.io/lookup/github.com/go-delve/[email protected]: 404 Not Found

staticcheck: failed to install staticcheck(honnef.co/go/tools/cmd/[email protected]): Error: Command failed: /usr/local/go/bin/go get -x honnef.co/go/tools/cmd/[email protected]
go: finding honnef.co v0.2.2

get https://goproxy.io/honnef.co/@v/v0.2.2.info

go: finding honnef.co/go/tools/cmd v0.2.2

get https://goproxy.io/honnef.co/go/tools/cmd/@v/v0.2.2.info

go: finding honnef.co/go/tools/cmd/staticcheck v0.2.2

get https://goproxy.io/honnef.co/go/tools/cmd/staticcheck/@v/v0.2.2.info

go: finding honnef.co/go v0.2.2

get https://goproxy.io/honnef.co/go/@v/v0.2.2.info

get https://goproxy.io/sumdb/gosum.io/supported

get https://goproxy.io/sumdb/gosum.io/supported: 200 OK (0.803s)

get https://goproxy.io/sumdb/gosum.io/lookup/honnef.co/go/[email protected]

get https://goproxy.io/sumdb/gosum.io/lookup/honnef.co/go/[email protected]: 404 Not Found (1.201s)

verifying honnef.co/go/[email protected]: honnef.co/go/[email protected]: reading https://goproxy.io/sumdb/gosum.io/lookup/honnef.co/go/[email protected]: 404 Not Found

gopls: failed to install gopls(golang.org/x/tools/gopls@latest): Error: Command failed: /usr/local/go/bin/go get -x golang.org/x/tools/gopls@latest

get https://goproxy.io/golang.org/@v/list

get https://goproxy.io/golang.org/x/tools/gopls/@v/list

get https://goproxy.io/golang.org/x/tools/@v/list

get https://goproxy.io/golang.org/x/@v/list

get https://goproxy.io/golang.org/x/tools/@v/list: 200 OK (1.078s)

get https://goproxy.io/golang.org/@v/list: 404 Not Found (1.078s)

get https://goproxy.io/golang.org/x/tools/gopls/@v/list: 200 OK (1.078s)

get https://goproxy.io/sumdb/gosum.io/supported

get https://goproxy.io/sumdb/gosum.io/supported: 200 OK (0.257s)

get https://goproxy.io/sumdb/gosum.io/lookup/golang.org/x/[email protected]

get https://goproxy.io/sumdb/gosum.io/lookup/golang.org/x/tools/[email protected]

get https://goproxy.io/golang.org/x/@v/list: 404 Not Found (1.818s)

get https://goproxy.io/sumdb/gosum.io/lookup/golang.org/x/tools/[email protected]: 404 Not Found (0.543s)

verifying golang.org/x/tools/[email protected]: golang.org/x/tools/[email protected]: reading https://goproxy.io/sumdb/gosum.io/lookup/golang.org/x/tools/[email protected]: 404 Not Found

你好,这是我的问题,我用的是vscode连接的远程ubuntu,想安装go插件但是不成功,下面是go env
GO111MODULE="on"
GOARCH="amd64"
GOBIN=""
GOCACHE="/root/.cache/go-build"
GOENV="/root/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/root/go"
GOPRIVATE=""
GOPROXY="https://goproxy.cn,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/dev/null"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build988944434=/tmp/go-build -gno-record-gcc-switches"

想问一下是什么情况,我没有使用代理,只使用了
$ go env -w GO111MODULE=on
$ go env -w GOPROXY=https://goproxy.cn,direct
两行代码,但是下载插件还是失败

@hailaz
Copy link

hailaz commented Nov 3, 2023

@digbangbang 看起来安装的时候没用使用到goproxy.cn,而是用了goproxy.io。可能是vscode远程的环境问题,需要再研究一下。

@hailaz
Copy link

hailaz commented Nov 3, 2023

@digbangbang vscode的用户和go env是同一个用户?
我看路径不同,是两个用户
这是你安装工具的路径:/home/lizhiwei/go/bin
这是你go env的路径:GOPATH="/root/go"

@digbangbang
Copy link

您可以和我说一下具体在vscode + wsl上安装go和插件的步骤吗,以及怎么配置,我好像在网上找不到具体的资料,导致错误很多,真的不好意思!

@hailaz
Copy link

hailaz commented Nov 3, 2023

@Void-zack
Copy link

如果是在vscode里安装插件工具包,得在将配置写入.profile文件后将主机重启,以重载vscode的配置。重启后vscode就可以正常使用goproxy下载插件工具包。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants