Skip to content

Commit

Permalink
fix: In runInit, install gobind without @latest .
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
jefft0 committed Oct 5, 2022
1 parent fa6bcb0 commit 2664156
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cmd/gomobile/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

0 comments on commit 2664156

Please sign in to comment.