golang “go get” command showing “go: missing Git command” error

后端 未结 5 1896
栀梦
栀梦 2021-02-01 17:22

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         


        
5条回答
  •  不思量自难忘°
    2021-02-01 18:08

    Locally

    Installing git will solve the issue.

    • for mac brew install git
    • for ubuntu sudo apt-get install git
    • for arch linux pacman -S git
    • for windows install git according to the instructions from the git installation page.

    In Docker

    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
    

提交回复
热议问题