I apologise for a newbie question but my understanding was that go build is supposed to download the dependencies automatically, but for me it requests to download it using go get. Once I download the dependencies it builds happily.
go install can also download modules. And I agree that go build is not supposed to download the dependencies automatically. I think go devs would consider that invasive; especially people who vendor dependencies to carefully control them.
Thank you, @christophberger and @Dean_Davidson. I was reading the O’Reiley LearningGo by J. Bodner which seems to suggest that packages are downloaded automatically
$ go build
go: finding module for package github.com/learning-go-book/simpletax
go: finding module for package github.com/shopspring/decimal
go: downloading github.com/learning-go-book/simpletax v1.1.0
go: found github.com/learning-go-book/simpletax in
go: found github.com/shopspring/decimal in github.com/shopspring/decimal v1.2.0
but it was not happening for me, so I was wondering if something wrong was with my setup.
Thank you both.