Home  >  Article  >  Backend Development  >  Where Should I Install the Google Cloud SDK and What Should My GOPATH Be?

Where Should I Install the Google Cloud SDK and What Should My GOPATH Be?

Patricia Arquette
Patricia ArquetteOriginal
2024-11-27 21:44:11629browse

Where Does Go Look for Google-Cloud-SDK, and What Should GOPATH Be?

Problem

Upon setting up Go App Engine on macOS, users may face difficulties determining the appropriate location for the google-cloud-sdk path, leading to errors such as "cannot download, /usr/local/google-cloud-sdk/... is a GOROOT, not a GOPATH."

Solution

Google-Cloud-SDK should not be placed in $GOROOT or $GOPATH. Instead, unpack it into your $HOME directory and run the installer. Add it to your $PATH by adding the following line to your .bash_profile:

export PATH=$HOME/google-cloud-sdk:$PATH

Obtain the GoLang SDK with gcloud components install app-engine-go.

Essential Notes

  • Adding the src directory of google-cloud-sdk/platform/google_appengine/goroot to $GOPATH can cause issues.
  • Do not manually alter $GOROOT unless compiling a new Go version from source.
  • When developing for App Engine, Go sources should be placed in your regular $GOPATH, not in google-cloud-sdk.
  • Deployments can be managed using the gcloud command.

Folder Structure

  • $GOPATH = $HOME/go

Where Should I Install the Google Cloud SDK and What Should My GOPATH Be?

  • Google-Cloud-SDK folder location:

Where Should I Install the Google Cloud SDK and What Should My GOPATH Be?

The above is the detailed content of Where Should I Install the Google Cloud SDK and What Should My GOPATH Be?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
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