Differences and Ties Between go get and go mod download Commands

There’s a subtle distinction between the go mod download and go get commands when it comes to fetching modules.

go get not only downloads but also adds dependencies straight into your go.mod file.

On the flip side, go mod download insists that the modules you’re after are already declared in go.mod—otherwise, it’ll throw a “cannot resolve” error your way.

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注