/plushcap/analysis/cockroach-labs/how-to-migrate-from-go-dep-to-go-modules

How to Migrate from Go Dep to Go Modules

What's this blog post about?

CockroachDB migrated from Go Dep to Go Modules due to the latter's widespread availability since Go 1.11 and its recommendation by dependent libraries. However, the migration process was not straightforward as it involved issues such as being unable to import vendored protobuf files, recognizing implicit upgrades and downgrades, and encountering errors writing go.mod. The team followed a guide from the "Migrating to Go Modules" page but had to adapt their approach for specific use cases like using protobufs and C files defined in Go modules. They also faced challenges with reproducible builds and the Go module cache, which they resolved by maintaining a separate git repo for vendors. Overall, despite some complications, the team found that Go Modules usage was smoother than using dep ensure and provided more intuitive management of modules.

Company
Cockroach Labs

Date published
March 31, 2021

Author(s)
Oliver Tan

Word count
3300

Hacker News points
11

Language
English


By Matt Makai. 2021-2024.