<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-us"><generator uri="https://gohugo.io/" version="0.101.0">Hugo</generator><title type="html">toolchain on A Scripter's Notes</title><subtitle type="html">Emacs, scripting and anything text oriented.</subtitle><link href="https://scripter.co/tags/toolchain/" rel="alternate" type="text/html" title="HTML"/><link href="https://scripter.co/tags/toolchain/index.xml" rel="alternate" type="application/rss+xml" title="RSS"/><link href="https://scripter.co/tags/toolchain/atom.xml" rel="self" type="application/atom+xml" title="Atom"/><link href="https://scripter.co/tags/toolchain/jf2feed.json" rel="alternate" type="application/jf2feed+json" title="jf2feed"/><updated>2026-04-22T08:24:58-04:00</updated><author><name>Kaushal Modi</name><email>kaushal.modi@gmail.com</email></author><id>https://scripter.co/tags/toolchain/</id><entry><title type="html">Installing go toolchain</title><link href="https://scripter.co/installing-go-toolchain/?utm_source=atom_feed" rel="alternate" type="text/html"/><id>https://scripter.co/installing-go-toolchain/</id><author><name>Kaushal Modi</name></author><published>2017-02-24T01:33:47-05:00</published><updated>2018-05-17T00:00:00-04:00</updated><content type="html"><![CDATA[<blockquote>&ldquo;Installing&rdquo; <code>go</code> is simply extracting its release archive, putting it
somewhere in you <code>$HOME</code> and pointing <code>GOROOT</code> and <code>PATH</code> env vars to
it.</blockquote><div class="ox-hugo-toc toc">
<div class="heading">Table of Contents</div>
<ul>
<li><a href="#installing-go">Installing <code>go</code></a></li>
<li><a href="#updating-go">Updating <code>go</code></a></li>
</ul>
</div>
<!--endtoc-->
<p>There are <strong>two</strong> reasons why I suggest installing <code>go</code> to anyone,
whether they are Go developers, or not (like me).</p>
<ol>
<li>You can then build amazing utilities like <a href="https://github.com/peco/peco">peco</a>, <a href="https://github.com/gohugoio/hugo">hugo</a> and <a href="https://github.com/variadico/noti">noti</a>.</li>
<li><strong>It&rsquo;s easy!</strong></li>
</ol>

<h2 id="installing-go">Installing <code>go</code>&nbsp;<a class="headline-hash no-text-decoration" href="#installing-go">#</a></h2>


<p>Below instructions are for installing <code>go</code> on a 64-bit GNU/Linux
machine, and using <code>tcsh</code> shell. But similar steps should work for any
other OS and shell.</p>
<ol>
<li>Download the <em>tar.gz</em> for the latest <em>linux-amd64</em> binaries from
<a href="https://golang.org/dl/">https://golang.org/dl/</a>.</li>
<li>Extract it to some place in your <code>$HOME</code>. I extract it to
<code>${HOME}/go/</code><sup id="fnref:1"><a href="#fn:1" class="footnote-ref" role="doc-noteref">1</a></sup>.</li>
<li>Create a directory where you would want to install the <code>go</code>
packages.
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-shell" data-lang="shell"><span class="line"><span class="cl">mkdir -p ~/go.apps
</span></span></code></pre></div></li>
<li>Set the following environment variables<sup id="fnref:2"><a href="#fn:2" class="footnote-ref" role="doc-noteref">2</a></sup>, and also save them to
your shell config:
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-tcsh" data-lang="tcsh"><span class="line"><span class="cl"><span class="nb">setenv </span>GOROOT <span class="k">${</span><span class="nv">HOME</span><span class="k">}</span>/go <span class="c"># go root</span>
</span></span><span class="line"><span class="cl"><span class="nb">setenv </span>GOPATH <span class="k">${</span><span class="nv">HOME</span><span class="k">}</span>/go.apps <span class="c"># for go applications</span>
</span></span></code></pre></div></li>
<li>Add the <code>${GOROOT}/bin</code> and <code>${GOPATH}/bin</code> directories to your
<code>$PATH</code>.</li>
</ol>
<p>Now you can install any <code>go</code> application!</p>
<p>For instance, <code>noti</code> is a nice little utility that triggers an alert
(desktop popup, <em>Pushbullet</em> notification, etc.) when a process
finishes.  From its <a href="https://github.com/variadico/noti#installation">installation notes</a>, you just run the below to
install it:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">go get -u github.com/variadico/noti/cmd/noti
</span></span></code></pre></div><p>Apart from the <code>go</code> applications I suggested here, <em>go</em> out and explore
more &ndash; <code>go get</code> them 😁</p>

<h2 id="updating-go">Updating <code>go</code>&nbsp;<a class="headline-hash no-text-decoration" href="#updating-go">#</a></h2>


<ol>
<li>Delete the existing <code>$GOROOT</code> directory (<strong>not <code>GOPATH</code>!</strong>)
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-shell" data-lang="shell"><span class="line"><span class="cl">rm -rf ~/go   <span class="c1"># as that is my GOROOT</span>
</span></span></code></pre></div></li>
<li>Download the <em>tar.gz</em> for the latest <em>linux-amd64</em> binaries.</li>
<li>Extract it to the same <code>$GOROOT</code> (<code>~/go</code> in my case).</li>
</ol>
<div class="footnotes" role="doc-endnotes">
<hr>
<ol>
<li id="fn:1">
<p>I prefer to not add the version number to my <code>go</code> installation
folder. That way, when I want to update it, I simply <code>rm -rf</code> it and
put in the new version.. and I don&rsquo;t need to update <code>GOROOT</code> or
<code>PATH</code>.&#160;<a href="#fnref:1" class="footnote-backref" role="doc-backlink">&#x21a9;&#xfe0e;</a></p>
</li>
<li id="fn:2">
<p>You can refer to these official <code>go</code> references [ <a href="https://golang.org/doc/install#tarball">1</a> ], [ <a href="https://golang.org/doc/install#testing">2</a> ] for
further information on these variables.&#160;<a href="#fnref:2" class="footnote-backref" role="doc-backlink">&#x21a9;&#xfe0e;</a></p>
</li>
</ol>
</div>
]]></content><category scheme="https://scripter.co/categories/unix" term="unix" label="unix"/><category scheme="https://scripter.co/tags/toolchain" term="toolchain" label="toolchain"/><category scheme="https://scripter.co/tags/golang" term="golang" label="golang"/></entry></feed>