Las herramientas de GoMobile no se reconocen (Golang)

Las herramientas de GoMobile no se reconocen (Golang)

Al instalarHerramientas móviles de GolangEn mi máquina con Windows 10-64 bits, no se reconocen las herramientas de gomobile. La ruta de instalación es laRUTA GOROOT C:\Ir.

Versión Go: -go1.11.5 ventanas/amd64está instalado en mi máquina.

Déjame saber cómo hacer que funcionen las herramientas móviles de Golang.

PS C:\Go>  go get golang.org/x/mobile/cmd/gomobile
PS C:\Go>  gomobile init
gomobile : The term 'gomobile' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path 
was included, verify that the path is correct and try again.
At line:1 char:2
+  gomobile init
+  ~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (gomobile:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

PS C:\Go> gomobile version
gomobile : The term 'gomobile' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path 
was included, verify that the path is correct and try again.
At line:1 char:1
+ gomobile version
+ ~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (gomobile:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

PS C:\Go> go version
go version go1.11.5 windows/amd64

Respuesta1

Las herramientas de Gomobile utilizan las rutas de referencia GOPATH y GOROOT proporcionadas en las variables de entorno/sistema para instalarse.

Se debe tener cuidado de proporcionar las rutas correctas y, tras la nueva instalación de GoVersion, se deben eliminar todas las rutas antiguas (que ya no son válidas).

Al seguir los pasos anteriores y apuntar las herramientas de Gomobile a GOPATH para su instalación, las herramientas de Gomobile funcionan bien.

Además, no es necesario poner "gomobile" en la ruta del entorno.

información relacionada