{"id":139,"date":"2018-10-05T13:06:08","date_gmt":"2018-10-05T13:06:08","guid":{"rendered":"http:\/\/kabiliravi.com\/?page_id=139"},"modified":"2019-07-21T13:47:54","modified_gmt":"2019-07-21T13:47:54","slug":"install","status":"publish","type":"page","link":"http:\/\/kabiliravi.com\/index.php\/software\/programming\/my-go-tutorial\/install\/","title":{"rendered":"Install Go"},"content":{"rendered":"<p>&nbsp;<\/p>\n<p>In order to install Go framework follow these instructions:<\/p>\n<h2>Linux<\/h2>\n<h3 style=\"padding-left: 30px;\">Debian\/Ubuntu<\/h3>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">$ apt-get install go<\/pre>\n<h3 style=\"padding-left: 30px;\">Redhat\/CentOS\/Fedora<\/h3>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">$ yum install go<\/pre>\n<h2>Mac OS<\/h2>\n<ol>\n<li>Install Go using <strong><strong><strong>brew<br \/>\n<\/strong><\/strong><\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">$ brew install go<\/pre>\n<\/li>\n<li>You might see following logs as bellow:\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">Updating Homebrew...\r\nxcrun: error: invalid active developer path (\/Library\/Developer\/CommandLineTools), missing xcrun at: \/Library\/Developer\/CommandLineTools\/usr\/bin\/xcrun\r\n==&gt; Auto-updated Homebrew!\r\nUpdated 3 taps (homebrew\/cask-versions, homebrew\/core and homebrew\/cask).\r\n==&gt; New Formulae\r\nazure-storage-cpp       fluxctl                 gitmoji                 healpix                 maven@3.5               mesa\r\n==&gt; Updated Formulae\r\nmaven \u2714                              elasticsearch                        libfabric                            q\r\nnode \u2714                               emscripten                           libgit2                              qcli\r\nruby \u2714                               erlang@20                            libgit2-glib                         ....\r\n....\r\n....\r\ndocker-ls                            libbitcoin-protocol                  pulumi                               youtube-dl\r\ndoitlive                             libbitcoin-server                    py2cairo\r\ndub                                  libdill                              py3cairo\r\nduc                                  liberasurecode                       python\r\n==&gt; Deleted Formulae\r\nkibana@4.4                           maven@3.0                            maven@3.1                            nethack4\r\n\r\n==&gt; Downloading https:\/\/homebrew.bintray.com\/bottles\/go-1.11.2.mojave.bottle.tar.gz\r\n######################################################################## 100.0%\r\n==&gt; Pouring go-1.11.2.mojave.bottle.tar.gz\r\n==&gt; Caveats\r\nA valid GOPATH is required to use the `go get` command.\r\nIf $GOPATH is not specified, $HOME\/go will be used by default:\r\n  https:\/\/golang.org\/doc\/code.html#GOPATH\r\n\r\nYou may wish to add the GOROOT-based install location to your PATH:\r\n  export PATH=$PATH:\/usr\/local\/opt\/go\/libexec\/bin\r\n==&gt; Summary\r\n?  \/usr\/local\/Cellar\/go\/1.11.2: 9,282 files, 404MB<\/pre>\n<\/li>\n<li>If you see following error:\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">xcrun: error: invalid active developer path (\/Library\/Developer\/CommandLineTools), missing xcrun at: \/Library\/Developer\/CommandLineTools\/usr\/bin\/xcrun<\/pre>\n<\/li>\n<li>that means you have not installed Xcode Development Command Line Tools which you can install it using following command:\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">$ xcode-select --install<\/pre>\n<\/li>\n<\/ol>\n<h2>Setup Go Workstation<\/h2>\n<ol>\n<li>You will see following prompt, click <strong>Install<\/strong> button:\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">$ vi ~\/.bash_profile<\/pre>\n<\/li>\n<li>if you might have installed <strong>zhs<\/strong> and <strong>ohmyzhs<\/strong> ~\/.zshrc\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">$ vi ~\/.zshrc<\/pre>\n<\/li>\n<li>Setup your paths, you can have these exports in your user home&nbsp;.bash_profile&nbsp;file&nbsp;and add following content into\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">export GOPATH=$HOME\/go\r\nexport GOBIN=$GOPATH\/bin\r\nexport PATH=$PATH:$GOBIN<\/pre>\n<\/li>\n<li>Run following source command to reload your&nbsp;<strong>.bash_profile<\/strong>&nbsp;or <strong>.zshrc<\/strong>.\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">$ source ~\/.bash_profile<\/pre>\n<\/li>\n<li>Make sure you create&nbsp;go\/src folders in your home folder\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">$ mkdir -p ~\/go\/bin\r\n$ mkdir -p ~\/go\/src\r\n$ mkdir -p ~\/go\/pkg<\/pre>\n<\/li>\n<\/ol>\n<h2>Microsoft Windows<\/h2>\n<p>Refer to&nbsp;https:\/\/golang.org\/doc\/install#windows for windows installation<\/p>\n","protected":false},"excerpt":{"rendered":"<p>&nbsp; In order to install Go framework follow these instructions: Linux Debian\/Ubuntu $ apt-get install go Redhat\/CentOS\/Fedora $ yum install go Mac OS Install Go using brew $ brew install go You might see following logs as bellow: Updating Homebrew&#8230; xcrun: error: invalid active developer path (\/Library\/Developer\/CommandLineTools), missing xcrun at: \/Library\/Developer\/CommandLineTools\/usr\/bin\/xcrun ==&gt; Auto-updated Homebrew! Updated [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":131,"menu_order":1,"comment_status":"open","ping_status":"closed","template":"","meta":{"ngg_post_thumbnail":0,"footnotes":""},"class_list":["post-139","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"http:\/\/kabiliravi.com\/index.php\/wp-json\/wp\/v2\/pages\/139","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/kabiliravi.com\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"http:\/\/kabiliravi.com\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"http:\/\/kabiliravi.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/kabiliravi.com\/index.php\/wp-json\/wp\/v2\/comments?post=139"}],"version-history":[{"count":22,"href":"http:\/\/kabiliravi.com\/index.php\/wp-json\/wp\/v2\/pages\/139\/revisions"}],"predecessor-version":[{"id":1387,"href":"http:\/\/kabiliravi.com\/index.php\/wp-json\/wp\/v2\/pages\/139\/revisions\/1387"}],"up":[{"embeddable":true,"href":"http:\/\/kabiliravi.com\/index.php\/wp-json\/wp\/v2\/pages\/131"}],"wp:attachment":[{"href":"http:\/\/kabiliravi.com\/index.php\/wp-json\/wp\/v2\/media?parent=139"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}