I'm new in go lang. Trying to import a go library using "go get" command but in cmd getting this error:
go: missing Git command. See https://golang.org/s/gogetcmd package github.com/ttacon/chalk: exec: "git": executable file not found in %PATH%
My Go Env:
set GOARCH=amd64 set GOBIN= set GOEXE=.exe set GOHOSTARCH=amd64 set GOHOSTOS=windows set GOOS=windows set GOPATH=F:\Works\Go set GORACE= set GOROOT=C:\Go set GOTOOLDIR=C:\Go\pkg\tool\windows_amd64 set GO15VENDOREXPERIMENT=1 set CC=gcc set GOGCCFLAGS=-m64 -mthreads -fmessage-length=0 set CXX=g++ set CGO_ENABLED=1
What's wrong with my Go environment?
go get
requires git if any of the packages lives (and is being fetched) from a git repository. For Windows, you can install git from the git website.
Installing git will solve the issue.
brew install git
sudo apt-get install git
pacman -S git
git installation page
.If you are getting while running in building docker image then you should install git there. [I got this issue while building docker image]
For Example: In my Dockerfile
FROM golang:alpine RUN apk add git
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With