I want to have all of my dependencies under source control alongside my projects in Go.
I can see there two main tools to do the job ( Dep and Glide ).
The problem is Dep States on its page that :
dep was the "official experiment." The Go toolchain, as of 1.11, has (experimentally) adopted an approach that sharply diverges from dep. As a result, we are continuing development of dep, but gearing work primarily towards the development of an alternative prototype for versioning behavior in the toolchain.
While Glide on the other hand, does not seem to have any activity on its repo.
I want to know what's the "best" way you guys are dealing with this?
I really love Go and it's philosophy but I must admit that dependency management is really messy.
In my experience, my solution is using go modules to manage dependencies. I got some problems with dep when install dependencies and it take me a lot of effort to fix it. So I switch to go module and it working as expect on production environment. Module is a built-in feature in Go which was introduced in Go 1.11 and starting in Go 1.13, module mode will be the default for all development.
Go modules make install dependencies faster and easier. With module, all dependencies will be listed in go.mod
file:
module example.com/hello
require (
github.com/some/dependency v1.2.3
github.com/another/dependency/v4 v4.0.0
)
How to get dependency:
go get github.com/some/dependency@v1.2.3