golang go get 无法正常工作,给出“package github.com/aws/aws-sdk-go/aws: exec: “git”: 在 %PATH% 中未找到可执行文件”

golang go get 无法正常工作,给出“package github.com/aws/aws-sdk-go/aws: exec: “git”: 在 %PATH% 中未找到可执行文件”

我刚刚从 golang.org 安装了 go,它是默认安装的,并且我是在默认状态下安装的(我在 Windows 上

PS C:\Users\admin\go\src\github.com\LearnGO> go env
set GOARCH=amd64
set GOBIN=
set GOCACHE=C:\Users\admin\AppData\Local\go-build
set GOEXE=.exe
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOOS=windows
set GOPATH=C:\Users\admin\go
set GOPROXY=
set GORACE=
set GOROOT=C:\Go
set GOTMPDIR=
set GOTOOLDIR=C:\Go\pkg\tool\windows_amd64
set GCCGO=gccgo
set CC=gcc
set CXX=g++
set CGO_ENABLED=1
set GOMOD=
set CGO_CFLAGS=-g -O2
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-g -O2
set CGO_FFLAGS=-g -O2
set CGO_LDFLAGS=-g -O2
set PKG_CONFIG=pkg-config
set GOGCCFLAGS=-m64 -mthreads -fmessage-length=0 -fdebug-prefix-map=C:\Users\admin\AppData\Local\Temp\go-build421030098=/tmp/go-build -gno-record-gcc-switches
PS C:\Users\admin\go\src\github.com\LearnGO>

我得到的错误是:

PS C:\Users\admin\go\src\github.com\LearnGO> go get github.com/aws/aws-sdk-go/aws
go: missing Git command. See https://golang.org/s/gogetcmd
package github.com/aws/aws-sdk-go/aws: exec: "git": executable file not found in %PATH%
PS C:\Users\admin\go\src\github.com\LearnGO>

答案1

您应该git先安装。

相关内容