Go 1.17 is deprecating the traditional use of '
A change recently landed in the development version of Go, and will be in Go 1.17, with the title of doc/go1.17: note deprecation of 'go get' for installing commands. The actual updated documentation (from the current draft release notes) says:
go getprints a deprecation warning when installing commands outside the main module (without the
go install cmd@versionshould be used instead to install a command at a specific version, using a suffix like
@v1.2.3. In Go 1.18, the
-dflag will always be enabled, and
go getwill only be used to change dependencies in
I have some views on this. The first one is that this is a pretty
abrupt deprecation schedule. Go will be printing a warning for only one
release, which means six months or so. People who don't update to every
Go version (or their operating system's packaged version doesn't) will
go from '
go get' working normally to install programs to having it
The bigger thing is that this particular deprecation is probably
going to mean that fewer people use utilities and other programs
written in Go. There are quite a lot of open source programs written
in Go out there that currently say to install them with '
...' in their READMEs and other resources. Starting with Go 1.18,
that's going to fail with some sort of error message. Some of these
programs are actively still being developed and maintained, and
perhaps will update their documentation to talk about '
Others are effectively inactive and will not update, so in the future
anyone following their instructions will fail and will probably give
up, despite the program still being perfectly good.
(There's probably also general documentation out on the Internet that
talks about using '
go get' to install Go programs, and that's also
going to be inaccurate. Hopefully none of them turn up high on search
engine results for how to install Go programs.)
On a philosophical level, I'm unhappy with Go deciding that it's going to rapidly discard something that was the way to do things for years and then probably the dominant way for several more years. Years of use build up a lot of momentum; the Go developers want that momentum to shift in months, in what is now a large community. People don't shift that fast, and I think the result is likely to be confusing and annoying people for quite some time.
(This is also in some sense a pointless shift. The Go developers
could as well say that plain '
go get' would become an alias for
go install ...@latest', instead of breaking it entirely. Yes,
this approach is in some sense more correct; it's also less humane.
It's robot logic (also).)