go问题

问题1: go install golang.org/x/tools/gopls@latest 失败

  • 解决方法:执行go env -w GOPROXY=https://goproxy.cn,direct后 ,再 执行 go install golang.org/x/tools/gopls@latest

image

问题2: go: go.mod file not found in current directory or any parent directory; see 'go help modules'

  • 解决方法1:cmd中输入:go env -w GO111MODULE=auto
  • 解决方法2:在当前目录下初始化go mod:执行命令:go mod init GolangBase
    image
posted @ 2025-07-19 16:06  Lucas_coming  阅读(51)  评论(0)    收藏  举报