PKG_CONFIG="pkg-config" 2.2 Method 2: Install golang from source code If the following appears, the installation is successfulįabric:~ fabric$ go -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/wc/bby1pbz17v3dkr8rmcpjptwm0000gn/T/go-build871394220=/tmp/go-build -gno-record-gcc-switches -fno-common" Try to see if golang has been installed successfully.Let the changes take effect fabric:~ fabric$ source ~/.bashrc I am accustomed to creating a new code directory in Documents under the home directory for storing codes in various languages, such as Documents/code/gopath for storing golang's code, Documents/code/www for storing php code. GOPATH can be set to other directories according to personal habits Configure Goang's related environment variablesĪdd the following to the above file #GOROOTĮxport GOPATH=$HOME/Documents/code/gopath.
If you need to have this software first in your PATH run: You may wish to add the GOROOT-based install location to your PATH:Įxport formula is keg-only, which means it was not symlinked into /usr/local,īecause this is an alternate version of another formula. If $GOPATH is not specified, $HOME/go will be used by default: Install the latest version of go under brewįabric:~ fabric$ brew install Homebrew.Ī valid GOPATH is required to use the `go get` command.Go-bindata goenv googler gst-plugins-good found that the latest 1.9 is available Go godep google-sql-tool gox wireguard-go Gnu-go gocryptfs google-sparsehash gowsdl wego Let's first see which golang versions are availableĪlgol68g go-jira gofabric8 goolabs gx-go go-statik goffice goose Hugo mongooseĬargo-completion gom goreleaser lego percona-server-mongodbĬertigo goaccess gomplate gost lgogdownloader pygobjectĬgoban goad goocanvas gosu libgosu pygobject3Ĭlingo gobby goofys gotags mongo-c-driver ringojsĭjango-completion gobject-introspection google-authenticator-libpam goto mongo-cxx-driver spaceinvaders-goįorego gobuster google-benchmark gource mongo-orchestration spigotįuego gocr google-java-format govendor mongodb svgo.
Read the analytics documentation (and how to opt-out) here:Ģ.1 Method 1: Install golang through brew => Homebrew has enabled anonymous aggregate user behaviour analytics. Successful installation => Installation successful! Let's start the installation.Įnter the following instructions at the command line fabric:~ fabric$ ruby -e "$(curl -fsSL )" Installing Apple with Homebrew is not pre-installed but What you need. Homebrew is somewhat similar to apt-get (Ubuntu) and Yum (yum) in Linux operating systems, which are used in Mac operating systems to solve package dependencies, in official terms: What can Homebrew do?
If you don't think you can use it for the time being, you can also not install it first. In this way, you can generate the docker image of golang program locally, throw it directly into the test environment, then you can test it, no more code upload, environment configuration and other operations. Docker is actually optional and packages applications into portable, self-contained containers.