today meet a problome about ' go get github.com/xxx/xxx', because URL(github.com/xxx/xxx) private repository, so 'go get' can't download .this article record solution method
代码如下(示例):
vim ~/.gitconfig
[user]
email = 1372702225@qq.com
name = gongsr-cn
[http]
extraheader = PRIVATE-TOKEN:ghp_************************************
[url "git@github.com:adolphxx"]
insteadOf = https://github.com/adolphxx
[url "git@github.com:gongsr-cn"]
insteadof = https://github.com/gongsr-cn
go env -w GOPRIVATE="github.com/xxxxx"
#not must
# github's account instead of *username*
# github's access token instead of *access token*
echo "machine https://github.com login *username* password *access token*" > ~/.netrc