I'm just getting started with Go and I'm not sure about go mod, go get and go mod vendor
Please note that it is highly possible that you are wrong.
Is the go.mod file something like Gemfile or package.json and the go.sum file like Gemfile.lock or package.lock.json?
go get package name
writes the package name to go.mod and go.sum
Does go get -u package name
update the version of the package written in go.mod and go.sum?
In other words, the procedure is the reverse of adding the desired gem to the Gemfile and doing bundle install to import the gem, and then go get the desired package and it will be automatically written to go.mod or go.sum?
Can you copy the package described in the file to go.mod under vendor with go mod vendor
?
Recommended Posts