From 75764a214b428bb10e4e43d3f43e63717ce99f3c Mon Sep 17 00:00:00 2001 From: jefft0 Date: Wed, 5 Oct 2022 02:24:09 -0700 Subject: [PATCH] fix: In runInit, install gobind without @latest . To "make sure gobind is up to date", runInit calls goInstall with "golang.org/x/mobile/cmd/gobind@latest" . But it shouldn't have "@latest". This instruction can replace the gobind command in the user's $GOPATH/bin with an unexpected version. Also, it is possible that "@latest" has a breaking change with the user's application. It is better to call goInstall without "@latest" so that it will follow the directives in the user's go.mod file. Signed-off-by: jefft0 --- cmd/gomobile/init.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/gomobile/init.go b/cmd/gomobile/init.go index e7392df71..6f2b12539 100644 --- a/cmd/gomobile/init.go +++ b/cmd/gomobile/init.go @@ -80,7 +80,7 @@ func runInit(cmd *command) error { }() // Make sure gobind is up to date. - if err := goInstall([]string{"golang.org/x/mobile/cmd/gobind@latest"}, nil); err != nil { + if err := goInstall([]string{"golang.org/x/mobile/cmd/gobind"}, nil); err != nil { return err }