Last active
November 17, 2020 07:44
-
-
Save taynguyen/568bf6020ef11471ed4ff3a1fe8dad89 to your computer and use it in GitHub Desktop.
Set up go project with private dependency
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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