I am using dep
, but I am quite seduced by built-in Go Modules in Go 1.11
In the docs, it says:
Go 1.11 includes preliminary support for versioned modules as proposed here. Modules are an experimental opt-in feature in Go 1.11, with the plan of incorporating feedback and finalizing the feature for Go 1.13. Even though some details may change, future releases will support modules defined using Go 1.11 or 1.12.
Even with that said, it seems that Go Modules are widely used by community and that they work pretty well.
So, for a new project, should I use Go Modules, or should I stick with dep
? I need help to take a decision.
In my opinion, you should switch to modules when starting a new project. Go 1.13 will be out in August (~2 months from now), having full support for modules, including default usage of the Go module mirror and checksum database.
Quoting from preliminary Go 1.13 release docs:
Go 1.13 is expected to be released in August 2019.
As of Go 1.13, the go command by default downloads and authenticates modules using the Go module mirror and Go checksum database run by Google. See https://proxy.golang.org/privacy for privacy information about these services and the go command documentation for configuration details including how to disable the use of these servers or use different ones.
I see more and more repositories adding a go.mod
file which means they are already tested and working with modules without any problems, and even if they don't have a go.mod
file, that doesn't mean they can't be used with modules, but manual adjustment to dependencies or vendoring might be needed.
Also don't forget: even if you don't start using modules now with your new project, you can switch to modules any time in the future, no one prevents that. But if you start with modules on day one, you will spare some work for yourself.