Go 1.17 will still support the old GOPATH mode (as well as modules)

May 30, 2021

It's no secret that the Go developers want to get rid of GOPATH based development (also known as non-modular mode). At some point in the future, Go modules will be our only option, as covered in their blog entry Eleven Years of Go. At the time, and even today, the GOPATH wiki page said about the timing of this:

  • Go 1.17 (August 2021) will remove the GO111MODULE setting and GOPATH [development] mode entirely, using module mode always.

Back in December when I wrote about this, I said in an aside that the timeline might be too aggressive and GOPATH mode might not be removed in Go 1.17. That seems to be what's happened, because the current development tree still supports GOPATH mode and Go 1.17 almost certainly will too, given where we are in Go's development and release cycle.

According to the Go Release Cycle, the general plan of Go progress is that after Go 1.16 was released, development happened for three months (February, March, and April), then the release freeze started May 1st. At this point, from what I can tell we're well into the Go 1.17 freeze (there have been commits to the Go tree that refer to it being in the freeze, for example). I think it would be pretty unusual to land a big (conceptual) change like the removal of GOPATH mode now, and even more unusual after the beta of 1.17 is made in a few days at the start of June.

(I was going to say that the actual implementation could be done by hardwiring GO111MODULE to 'on' and ignoring the environment variable, which could make it a small change in terms of the amount of code, but after looking at the existing code a little bit I'm not sure it's that simple.)

My current Go issue searches haven't turned up any sort of tracking issue for removing GOPATH mode, so I can't tell if the Go team didn't have time to get to this before the freeze or if they decided to wait longer to give modules more time to percolate through the ecosystem of existing packages. Whichever they picked, I'm glad that they made this choice; I still build a variety of other people's Go programs that haven't been modularized yet, so the removal of GOPATH mode would have directly affected me.

PS: Presumably the GOPATH wiki page will be updated at some point, either to set the future date to Go 1.18 (February 2022) or just to leave it indeterminate.

Written on 30 May 2021.
« Less can filter what it shows to you (a thing I recently learned)
I've come to like date-based names for log rotation »

Page tools: View Source, Add Comment.
Search:
Login: Password:
Atom Syndication: Recent Comments.

Last modified: Sun May 30 00:26:42 2021
This dinky wiki is brought to you by the Insane Hackers Guild, Python sub-branch.