How do I configure go command to use a proxy?

后端 未结 7 1674
鱼传尺愫
鱼传尺愫 2020-12-02 05:34

I want to run go install to install the tour, but I can\'t find the option to use a proxy for internet access. I don\'t need this just for the tour but for deve

7条回答
  •  Happy的楠姐
    2020-12-02 05:34

    git config [--global] http.proxy http://proxy.example.com:port
    git config [--global] https.proxy http://proxy.example.com:port
    

    see https://github.com/golang/go/wiki/GoGetProxyConfig

    Note: This answer has received both positive and negative feedback, if this method does not help on your case, please leave some comments before you click down-vote, cause this is actually documented and is working in my case. We'd better know why it does not work for you. Thanks.

提交回复
热议问题