Home > Backend Development > Golang > Where Does Go Find the google-cloud-sdk and How Should GOPATH Be Set?

Where Does Go Find the google-cloud-sdk and How Should GOPATH Be Set?

Patricia Arquette
Release: 2024-12-04 18:08:19
Original
857 people have browsed it

Where Does Go Find the google-cloud-sdk and How Should GOPATH Be Set?

Where does GO look for google-cloud-sdk?

GO does not look for the google-cloud-sdk in either $GOROOT or $GOPATH. To set up the google-cloud-sdk, simply unpack it to your $HOME directory and run the installer.

What should GOPATH be?

Your $GOPATH should be set to your normal installation. The App Engine SDK for Go automatically uses the sources in the google-cloud-sdk/platform/google_appengine/goroot/src directory without any manipulation.

Additional Tips:

Do not manually change $GOROOT unless you are planning on compiling a new Go version from source. If your installation is messed up beyond repair, remove the cloud SDK and any references to it in your $PATH. Also, completely uninstall the regular Go installation. Then start from scratch by installing Go, unpacking google-cloud-sdk, running the installer, and gcloud components installing app-engine-go.

When developing for App Engine, your Go sources should go into your regular $GOPATH, not in the google-cloud-sdk/ directory. To run the dev_appserver locally, run dev_appserver.py [path-to-source], where the given path contains your code and the app.yaml.

Edited Folder Structure:

$GOPATH = $HOME/go

[Image of the edited folder structure]

Location for google-cloud-sdk folder:

[Image of the location for google-cloud-sdk folder]

The above is the detailed content of Where Does Go Find the google-cloud-sdk and How Should GOPATH Be Set?. For more information, please follow other related articles on the PHP Chinese website!

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template