Skip to content

Instantly share code, notes, and snippets.

@taynguyen
Last active November 17, 2020 07:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save taynguyen/568bf6020ef11471ed4ff3a1fe8dad89 to your computer and use it in GitHub Desktop.
Save taynguyen/568bf6020ef11471ed4ff3a1fe8dad89 to your computer and use it in GitHub Desktop.
Set up go project with private dependency
# Set up go project with private dependency
Goal:
- Set up project with private dependency using go module.
## Using access token
Override access token to your git config, so it would include username and access key, so that you would be able to use go get your private repo
```
git config --global url."https://${username}:${access_token}@gitlab.com".insteadOf "https://gitlab.com"
```
## Set go env GOPRIVATE
To skip check sum
```
go env -w GOPRIVATE=<your package>
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment