Last active
April 16, 2019 18:22
-
-
Save jesusvazquez/a97df0f4b6776b07f811c7ea99b2c5e6 to your computer and use it in GitHub Desktop.
Migrate golang project from dep to go mod
This file contains hidden or 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
# Quick list of steps to initialize go mod in your go project. | |
# Make sure to do this out of the GOPATH or play around with GO111MODULE env var | |
# Initialize project | |
go mod init github.com/<repository_path>/<project_name> | |
go build -o /tmp/main main.go | |
rm /tmp/main | |
# Remove traces of dep | |
rm -rf vendor | |
rm Gopkg.* | |
# Verify dependencies are there | |
go list -m all |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment