如何安装 go mobile 并让它在 windows 上运行?

How can I install go mobile and have it work on windows?

我在使用以下命令在 windows 上安装 gomobile 时遇到问题: go get golang.org/x/mobile/cmd/gomobile

它没有给我任何错误,但它似乎没有做任何事情。之后尝试执行 gomobile 时出现错误:

'gomobile' is not recognized as an internal or external command, operable program or batch file.

您是否已将 gomobile 位置的路径添加到您的 PATH 变量中?

检查是否包含在批处理命令中

set PATH

所以我想出了 go 可执行文件所在的路径与 GOPATH 不同。为了找到我的 GOPATH 是什么,我使用了命令

go env GOPATH