Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
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<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