Upgrade Go Install Installed Versions of 3rd Party Tools

Updated at: 2020-06-06 Views: 1412 Words: 184 Category: golang

Today, while using the adm generate command from GoAdmin, I found a new version prompt.

GoAdmin CLI v1.2.9, the latest version is v1.2.13 now.

The adm command line tool is installed by go install.

So I tried to run it again:

> go install github.com/GoAdminGroup/go-... admin/adm

But after installation, I found that it is still the old version.

So, tried to add latest to the github address again, and got error.

> go install github.com/GoAdminGroup/go-... admin/[email protected]
can't load package: package github.com/ GoAdminGroup/go-admin/[email protected]: can only use [email protected] syntax with 'go get'

I had to use go get latest to fix it.

> go get github.com/GoAdminGroup/go-admin/ [email protected]
go: found github.com/GoAdminGroup/go-admin/ adm in github.com/GoAdminGroup/go-admin v1.2.13
go: github.com/GoAdminGroup/go-admin latest => v1.2.13

Run adm generate again and find that it is the latest version.

However, as a side effect go.mod has been updated as well.

Should I keep the update of go.mod?

I think it's desirable because once you change development machines, or teams develop collaboratively, unifying versions of the tripartite command is necessary.

A related discussion on github

https://github.com/golang/go/issues/30515

Leave a Comment