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/goge
If you're running this as a Jenkins pipeline script, start your Docker image like:
node('docker') {
docker.image('golang:1.14rc1-alpine3.11').inside(' -u 0') {
sh 'apk add curl'
...
}
}
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.
The go get fetching of source code is done by using one of the following tools expected to be found on your system either git, svn, hg.
Install git from this link https://git-scm.com/downloads
After installing git you should navigate to the environment variables setting and add the path of git.exe(executable file) which is found in the bin. So the path should look like this "C:\Program Files\Git\bin". Restart your IDE and the command should be working.
Install git.
for Ubuntu, you can use the command
sudo apt-get install git
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