-2

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.

Juliatzin
  • 18,455
  • 40
  • 166
  • 325
  • 1
    What you should or should not do is a matter of opinion. There are pros and cons to any such decision. We can't tell you what to do. – Jonathan Hall Jun 21 '19 at 09:22
  • 4
    IMO 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. Also don't forget: if you start with `dep`, you will always have the option to switch to modules in the future... It's not like what you choose now you will have to carry for the rest of your life. – icza Jun 21 '19 at 09:22
  • @icza Ok, the 2 months arguments is good. You could put it as an answer – Juliatzin Jun 21 '19 at 09:33
  • 2
    Not sure what you mean by "in production". Modules have no impact on *running* a program, only on *building* it, which shouldn't be happening "in production". Production should be where you run a built application. – Adrian Jun 21 '19 at 13:40
  • There are still some problems with the tooling and editors like VS Code. However, the modules are widely accepted. – Inanc Gumus Aug 03 '19 at 03:16

1 Answers1

0

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.

Community
  • 1
  • 1
icza
  • 389,944
  • 63
  • 907
  • 827