Sobes.tech
Junior — Middle

Kas saaksite nimetada kõige levinumaid tööriistu sõltuvuste haldamiseks projektides?

sobes.tech AI

Vastus AI-lt

In Go, the most common tool for dependency management is Go Modules (go mod). It has been integrated into the standard Go toolset since version 1.11 and allows managing library versions, automatically downloading and caching dependencies.

Previously, tools like dep and Glide were used, but they are now considered deprecated.

Example of module initialization and adding a dependency:

go mod init example.com/myproject

go get github.com/sirupsen/logrus@v1.8.1

This will create a go.mod file describing the dependencies and their versions.