美文网首页
Vscode下安装gotests等失败问题

Vscode下安装gotests等失败问题

作者: crazy一笑 | 来源:发表于2023-08-09 09:49 被阅读0次

例如:Installing github.com/cweill/gotests/gotests@v1.6.0 FAILED
终端执行,检查go是否安装成功

 go

出现以下内容说明安装没问题

  Go is a tool for managing Go source code.

Usage:

    go <command> [arguments]

The commands are:

    bug         start a bug report
    build       compile packages and dependencies
    clean       remove object files and cached files
    doc         show documentation for package or symbol
    env         print Go environment information
    fix         update packages to use new APIs
    fmt         gofmt (reformat) package sources
    generate    generate Go files by processing source
    get         add dependencies to current module and install them
    install     compile and install packages and dependencies
    list        list packages or modules
    mod         module maintenance
    work        workspace maintenance
    run         compile and run Go program
    test        test packages
    tool        run specified go tool
    version     print Go version
    vet         report likely mistakes in packages

Use "go help <command>" for more information about a command.

Additional help topics:

    buildconstraint build constraints
    buildmode       build modes
    c               calling between Go and C
    cache           build and test caching
    environment     environment variables
    filetype        file types
    go.mod          the go.mod file
    gopath          GOPATH environment variable
    gopath-get      legacy GOPATH go get
    goproxy         module proxy protocol
    importpath      import path syntax
    modules         modules, module versions, and more
    module-get      module-aware go get
    module-auth     module authentication using go.sum
    packages        package lists and patterns
    private         configuration for downloading non-public code
    testflag        testing flags
    testfunc        testing functions
    vcs             controlling version control with GOVCS

Use "go help <topic>" for more information about that topic.

执行下面两个命令,换go mod代理

 go env -w GO111MODULE=on
 go env -w GOPROXY=https://proxy.golang.com.cn,direct

再次打开vscode,Commond s保存,选择Install All,出现以下内容则表示成功:

Tools environment: GOPATH=/Users/xxx/go
Installing 7 tools at /Users/xxx/go/bin in module mode.
  gotests
  gomodifytags
  impl
  goplay
  dlv
  staticcheck
  gopls

Installing github.com/cweill/gotests/gotests@v1.6.0 (/Users/liuhao/go/bin/gotests) SUCCEEDED
Installing github.com/fatih/gomodifytags@v1.16.0 (/Users/liuhao/go/bin/gomodifytags) SUCCEEDED
Installing github.com/josharian/impl@v1.1.0 (/Users/liuhao/go/bin/impl) SUCCEEDED
Installing github.com/haya14busa/goplay/cmd/goplay@v1.0.0 (/Users/liuhao/go/bin/goplay) SUCCEEDED
Installing github.com/go-delve/delve/cmd/dlv@latest (/Users/liuhao/go/bin/dlv) SUCCEEDED
Installing honnef.co/go/tools/cmd/staticcheck@latest (/Users/liuhao/go/bin/staticcheck) SUCCEEDED
Installing golang.org/x/tools/gopls@latest (/Users/liuhao/go/bin/gopls) SUCCEEDED

All tools successfully installed. You are ready to Go. :)

相关文章

网友评论

      本文标题:Vscode下安装gotests等失败问题

      本文链接:https://www.haomeiwen.com/subject/cibopdtx.html