Skip to content

Instantly share code, notes, and snippets.

@jesusvazquez
Last active April 16, 2019 18:22
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 jesusvazquez/a97df0f4b6776b07f811c7ea99b2c5e6 to your computer and use it in GitHub Desktop.
Save jesusvazquez/a97df0f4b6776b07f811c7ea99b2c5e6 to your computer and use it in GitHub Desktop.
Migrate golang project from dep to go mod
# 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