GOPATH deprecation in 1.17

648 views
Skip to first unread message

Alejandro Saez Morollon

unread,
Jun 21, 2021, 2:07:56 PM6/21/21
to golan...@googlegroups.com
Hi! I was wondering if there's a tracking issue for the GOPATH
deprecation in Go 1.17.
According to this link[0] 1.17 is going to be removed in Go 1.17, but
I was trying out the 1.17beta1 with some Fedora packages, and I
realized it behaves similar to 1.16.

For context: Fedora relies heavily on GOPATH for the dependencies.

Am I missing something?

Kind regards.

[0] https://github.com/golang/go/wiki/GOPATH

Ian Lance Taylor

unread,
Jun 21, 2021, 2:23:56 PM6/21/21
to Alejandro Saez Morollon, golang-dev
On Mon, Jun 21, 2021 at 11:07 AM Alejandro Saez Morollon <a...@redhat.com> wrote:
>
> Hi! I was wondering if there's a tracking issue for the GOPATH
> deprecation in Go 1.17.
> According to this link[0] 1.17 is going to be removed in Go 1.17, but
> I was trying out the 1.17beta1 with some Fedora packages, and I
> realized it behaves similar to 1.16.
>
> For context: Fedora relies heavily on GOPATH for the dependencies.
>
> Am I missing something?

You probably aren't missing anything: GOPATH support was not removed
in 1.17. I personally do not know when it will be removed (someone
else may know).

I updated the wiki page.

But GOPATH support will still be removed in some future release. Is
it possible for Fedora to stop using GOPATH?

Ian

Alberto Donizetti

unread,
Jun 21, 2021, 2:27:02 PM6/21/21
to golang-dev, Alejandro Saez Morollon
Note that the page you linked says:

> removing GOPATH development mode does not mean removing the GOPATH
variable. It will still be used for the purposes listed at the top
of this page.

So I'm assuming that you want to know about "GOPATH mode", because
the GOPATH folder itself is not going away.

I believe the current plan (at least regarding go get) is to print a
deprecation warning in 1.17, and change the default behaviour for go
1.18. This was tracked here:

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

In particular this comment:

https://github.com/golang/go/issues/43684#issuecomment-831325476

The issue tracked the addition of the warning, and then it was supposed to be
re-milestoned to 1.18 for the actual change in behaviour, but it looks like
it was actually closed by mistake.

Alberto
> --
> You received this message because you are subscribed to the Google Groups "golang-dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to golang-dev+...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/golang-dev/CAOyqgcVEbZnQSLz3ppR2XCSnSNnbhSa-o8OA8srXOcSka6cKyA%40mail.gmail.com.

Jay Conrod

unread,
Jun 21, 2021, 2:40:32 PM6/21/21
to Alberto Donizetti, golang-dev, Alejandro Saez Morollon
https://github.com/golang/go/issues/43684 only covers using 'go get' to build and install binaries in module-aware mode.

For GOPATH mode for finding, loading, and building packages (i.e., what the go command does with GO111MODULE=off): we don't actually have a concrete plan to remove it yet. There won't be any major change in Go 1.17. It's possible we'll print a deprecation notice in 1.18, but we haven't settled on anything.

Alejandro Saez Morollon

unread,
Jun 21, 2021, 2:54:50 PM6/21/21
to Ian Lance Taylor, golang-dev
On Mon, Jun 21, 2021 at 8:23 PM Ian Lance Taylor <ia...@golang.org> wrote:
>
> On Mon, Jun 21, 2021 at 11:07 AM Alejandro Saez Morollon <a...@redhat.com> wrote:
> >
> > Hi! I was wondering if there's a tracking issue for the GOPATH
> > deprecation in Go 1.17.
> > According to this link[0] 1.17 is going to be removed in Go 1.17, but
> > I was trying out the 1.17beta1 with some Fedora packages, and I
> > realized it behaves similar to 1.16.
> >
> > For context: Fedora relies heavily on GOPATH for the dependencies.
> >
> > Am I missing something?
>
> You probably aren't missing anything: GOPATH support was not removed
> in 1.17. I personally do not know when it will be removed (someone
> else may know).
>
> I updated the wiki page.
>

Thanks!

> But GOPATH support will still be removed in some future release. Is
> it possible for Fedora to stop using GOPATH?

Yes, we are going to stop using it as soon as possible, although I
don't have an elegant solution yet.
In fact I found about this while doing tests with some packages in
order to remove the GOPATH dependency.

> Ian
>

Alejandro Saez Morollon

unread,
Jun 21, 2021, 2:55:26 PM6/21/21
to Jay Conrod, golang-dev
Thanks a lot for the clarification!
Reply all
Reply to author
Forward
0 new messages