0

after an OS re-install (MacOS Big Sur) I'm trying to get my go & gomobile development environment set up again. I have a specific version requirement for my app so I am using go 1.13.x, installed via homebrew.

I then installed gomobile via the command: go get golang.org/x/mobile/cmd/gomobile

The problem occurs when I run the following command: gomobile init, this throws the following error:

gomobile: Go 1.16 or newer is required

Before the OS rebuild I had the same go version (1.13.x) installed and gomobile worked, it never threw that error. After googling a bit my question is, is there a repository or place where I can download the gomobile binary for an earlier version? The website seems to only show a single "v0" version, which is the one causing the problem. Perhaps even if there's a way to build an older version from source?

Thanks in advance for any pointers!

Dominik
  • 1,366
  • 2
  • 18
  • 37
  • You need to use `go get` to request the specific version you want. If you didn't record that version in your module you will need to do the research to figure out which specific commit you were using. (Are you certain that you need an older Go version? There are very few backward compatibility concerns, and go1.13 is no longer maintained) – JimB Oct 19 '21 at 12:32
  • Hi JimB, go get does not work for my environment with a specific version when used in GOPATH mode, the error is `go: cannot use path@version syntax in GOPATH mode`. And yes, I'd love to find the specific commit, can you point me at the repo that contains gomobile? – Dominik Oct 19 '21 at 21:53
  • 1
    Why not use a module and avoid this issue again later? If you want to use GOPATH, use `go get` and then checkout the commit you want in the cloned repo. If you want the remote repo, the url for the package takes you to [the documentation](https://pkg.go.dev/golang.org/x/mobile/cmd/gomobile), which has a [link to the repo](https://cs.opensource.google/go/x/mobile). – JimB Oct 19 '21 at 22:09
  • Thank you, not sure why I could not find that repo link, I think that's enough to get me unstuck. Thanks JimB! – Dominik Oct 19 '21 at 22:22

1 Answers1

0

Per the Go release policy, Go 1.13 hasn't been supported by the Go project for quite some time — for example, it hasn't received any security fixes since August 2020.

Instead of downgrading gomobile, upgrade to a supported version of the Go toolchain — see https://golang.org/doc/install for instructions.

bcmills
  • 4,391
  • 24
  • 34
  • Sorry, as per my post I am stuck with a very specific go version, it's old code running on old devices with a go app embedded within a mobile app. I have tried upgrading, but that breaks the application with no clear indication as to the root cause, i.e. something in the go layer of the app has changed - with no code changes besides the upgrade. That's why I am exploring getting back the version of the file I had previously as it worked. – Dominik Oct 19 '21 at 21:55