doc/install: fix Linux tab installation command

There is a command on doc/install page https://golang.org/doc/install that uses an outdated filename that is being shown as an example of how to install go for Linux:

tar -C /usr/local -xzf go1.14.3.linux-amd64.tar.gz

Currently, there is a button that allows downloading .tar file that include go1.15 and its name is different from the command, so that if you follow installation steps you'll get an error that .tar file wasn't found.

Changes purposed:
Added a function that uses a filename from the "Download" button that can be used to update Linux installation command.
This function could be used in the future for other OSes if there will be a need for adding informational data that may change in the future. So there's no need to update such data in the markup files.
If there's something wrong during running JS code (or JS is disabled in the browser) and the filename couldn't be parsed - the old filename is used as an example like before.

Fixes golang/go#41232

Change-Id: Ie389ce73de5393f151ad739b3e97873e1a9be179
GitHub-Last-Rev: 0a93f69393a0b81ee1d869bfb7df612278479c1b
GitHub-Pull-Request: golang/website#15
Reviewed-on: https://go-review.googlesource.com/c/website/+/253118
Run-TryBot: Steve Traut <straut@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Steve Traut <straut@google.com>
diff --git a/content/static/doc/download.js b/content/static/doc/download.js
index 3f463ad..46aa5c8 100644
--- a/content/static/doc/download.js
+++ b/content/static/doc/download.js
@@ -84,6 +84,23 @@
     }
   }
 
+  // Updates install tab with dynamic data.
+  setInstallTabData(osName) {
+    const fnId = `#${osName}-filename`;
+    const el = document.querySelector(fnId);
+    if (!el) {
+      return;
+    }
+    switch(osName) {
+      case 'linux':
+        // Update filename for linux installation step
+        if (this.linuxFileName) {
+          el.textContent = this.linuxFileName;
+        }
+        break;
+    }
+  }
+
   // Detect the users OS for installation default.
   detectOS() {
     if (navigator.appVersion.indexOf('Linux') !== -1) {
@@ -117,6 +134,7 @@
     const el = (e.target);
     this.activateTab(Array.prototype.indexOf.call(this.tabs, el));
     this.setDownloadForOS(el.id);
+    this.setInstallTabData(el.id);
   }
 
 }
diff --git a/content/static/doc/install.html b/content/static/doc/install.html
index 86f1bc2..b759457 100644
--- a/content/static/doc/install.html
+++ b/content/static/doc/install.html
@@ -91,7 +91,7 @@
           For example, run the following as root or through <code>sudo</code>:
         </p>
         <pre>
-tar -C /usr/local -xzf go1.14.3.linux-amd64.tar.gz
+tar -C /usr/local -xzf <span id="linux-filename">go1.14.3.linux-amd64.tar.gz</span>
 </pre
         >
       </li>
@@ -201,4 +201,4 @@
   some simple Go code. It takes about 10 minutes to complete.
 </p>
 
-<script async src="/doc/download.js"></script>
\ No newline at end of file
+<script async src="/doc/download.js"></script>
diff --git a/content/static/static.go b/content/static/static.go
index 0b979d8..66f6e89 100644
--- a/content/static/static.go
+++ b/content/static/static.go
@@ -61,11 +61,11 @@
 
 	"doc/docs.html": "<!--{\x0a\x09\"Title\":\x20\"Documentation\",\x0a\x09\"Path\":\x20\"/doc/\",\x0a\x09\"Template\":\x20true\x0a}-->\x0a\x0a<p>\x0aThe\x20Go\x20programming\x20language\x20is\x20an\x20open\x20source\x20project\x20to\x20make\x20programmers\x20more\x0aproductive.\x0a</p>\x0a\x0a<p>\x0aGo\x20is\x20expressive,\x20concise,\x20clean,\x20and\x20efficient.\x20Its\x20concurrency\x0amechanisms\x20make\x20it\x20easy\x20to\x20write\x20programs\x20that\x20get\x20the\x20most\x20out\x20of\x20multicore\x0aand\x20networked\x20machines,\x20while\x20its\x20novel\x20type\x20system\x20enables\x20flexible\x20and\x0amodular\x20program\x20construction.\x20Go\x20compiles\x20quickly\x20to\x20machine\x20code\x20yet\x20has\x20the\x0aconvenience\x20of\x20garbage\x20collection\x20and\x20the\x20power\x20of\x20run-time\x20reflection.\x20It's\x20a\x0afast,\x20statically\x20typed,\x20compiled\x20language\x20that\x20feels\x20like\x20a\x20dynamically\x20typed,\x0ainterpreted\x20language.\x0a</p>\x0a\x0a<div\x20id=\"manual-nav\"></div>\x0a\x0a<h2\x20id=\"getting-started\">Getting\x20started</h2>\x0a\x0a<h3\x20id=\"installing\"><a\x20href=\"/doc/install\">Installing\x20Go</a></h3>\x0a<p>\x0aInstructions\x20for\x20downloading\x20and\x20installing\x20Go.\x0a</p>\x0a\x0a<h3\x20id=\"get-started-tutorial\"><a\x20href=\"/doc/tutorial/getting-started.html\">Tutorial:\x20Getting\x20started</a></h3>\x0a<p>\x0aA\x20brief\x20Hello,\x20World\x20tutorial\x20to\x20get\x20started.\x20Learn\x20a\x20bit\x20about\x20Go\x20code,\x20tools,\x20packages,\x20and\x20modules.\x0a</p>\x0a\x0a<h3\x20id=\"create-module-tutorial\"><a\x20href=\"/doc/tutorial/create-module.html\">Tutorial:\x20Create\x20a\x20module</a></h3>\x0a<p>\x0aA\x20tutorial\x20of\x20short\x20topics\x20introducing\x20functions,\x20error\x20handling,\x20arrays,\x20maps,\x20unit\x20testing,\x20and\x20compiling.\x0a</p>\x0a\x0a<h2\x20id=\"learning\">Learning\x20Go</h2>\x0a\x0a<img\x20class=\"gopher\"\x20src=\"/doc/gopher/doc.png\"\x20alt=\"\"/>\x0a\x0a<h3\x20id=\"go_tour\">\x0a\x09{{if\x20$.GoogleCN}}\x0a\x09\x20\x20A\x20Tour\x20of\x20Go\x0a\x09{{else}}\x0a\x09\x20\x20<a\x20href=\"//tour.golang.org/\">A\x20Tour\x20of\x20Go</a>\x0a\x09{{end}}\x0a</h3>\x0a<p>\x0aAn\x20interactive\x20introduction\x20to\x20Go\x20in\x20three\x20sections.\x0aThe\x20first\x20section\x20covers\x20basic\x20syntax\x20and\x20data\x20structures;\x20the\x20second\x20discusses\x0amethods\x20and\x20interfaces;\x20and\x20the\x20third\x20introduces\x20Go's\x20concurrency\x20primitives.\x0aEach\x20section\x20concludes\x20with\x20a\x20few\x20exercises\x20so\x20you\x20can\x20practice\x20what\x20you've\x0alearned.\x20You\x20can\x20{{if\x20not\x20$.GoogleCN}}<a\x20href=\"//tour.golang.org/\">take\x20the\x20tour\x0aonline</a>\x20or{{end}}\x20install\x20it\x20locally\x20with:\x0a</p>\x0a<pre>\x0a$\x20go\x20get\x20golang.org/x/tour\x0a</pre>\x0a<p>\x0aThis\x20will\x20place\x20the\x20<code>tour</code>\x20binary\x20in\x20your\x20workspace's\x20<code>bin</code>\x20directory.\x0a</p>\x0a\x0a<h3\x20id=\"code\"><a\x20href=\"code.html\">How\x20to\x20write\x20Go\x20code</a></h3>\x0a<p>\x0aThis\x20doc\x20explains\x20how\x20to\x20develop\x20a\x20simple\x20set\x20of\x20Go\x20packages\x20inside\x20a\x20module,\x0aand\x20it\x20shows\x20how\x20to\x20use\x20the\x20<a\x20href=\"/cmd/go/\"><code>go</code>&nbsp;command</a>\x0ato\x20build\x20and\x20test\x20packages.\x0a</p>\x0a\x0a<h3\x20id=\"editors\"><a\x20href=\"editors.html\">Editor\x20plugins\x20and\x20IDEs</a></h3>\x0a<p>\x0aA\x20document\x20that\x20summarizes\x20commonly\x20used\x20editor\x20plugins\x20and\x20IDEs\x20with\x0aGo\x20support.\x0a</p>\x0a\x0a<h3\x20id=\"effective_go\"><a\x20href=\"effective_go.html\">Effective\x20Go</a></h3>\x0a<p>\x0aA\x20document\x20that\x20gives\x20tips\x20for\x20writing\x20clear,\x20idiomatic\x20Go\x20code.\x0aA\x20must\x20read\x20for\x20any\x20new\x20Go\x20programmer.\x20It\x20augments\x20the\x20tour\x20and\x0athe\x20language\x20specification,\x20both\x20of\x20which\x20should\x20be\x20read\x20first.\x0a</p>\x0a\x0a<h3\x20id=\"diagnostics\"><a\x20href=\"/doc/diagnostics.html\">Diagnostics</a></h3>\x0a<p>\x0aSummarizes\x20tools\x20and\x20methodologies\x20to\x20diagnose\x20problems\x20in\x20Go\x20programs.\x0a</p>\x0a\x0a<h3\x20id=\"faq\"><a\x20href=\"/doc/faq\">Frequently\x20Asked\x20Questions\x20(FAQ)</a></h3>\x0a<p>\x0aAnswers\x20to\x20common\x20questions\x20about\x20Go.\x0a</p>\x0a\x0a<h3\x20id=\"tutorials\"><a\x20href=\"/doc/tutorial/\">Tutorials</a></h3>\x0a<p>\x0aA\x20list\x20of\x20tutorials\x20to\x20get\x20started\x20with\x20Go.\x0a</p>\x0a\x0a<h3\x20id=\"wiki\"><a\x20href=\"/wiki\">The\x20Go\x20Wiki</a></h3>\x0a<p>A\x20wiki\x20maintained\x20by\x20the\x20Go\x20community.</p>\x0a\x0a<h4\x20id=\"learn_more\">More</h4>\x0a<p>\x0aSee\x20the\x20<a\x20href=\"/wiki/Learn\">Learn</a>\x20page\x20at\x20the\x20<a\x20href=\"/wiki\">Wiki</a>\x0afor\x20more\x20Go\x20learning\x20resources.\x0a</p>\x0a\x0a\x0a<h2\x20id=\"references\">References</h2>\x0a\x0a<h3\x20id=\"pkg\"><a\x20href=\"/pkg/\">Package\x20Documentation</a></h3>\x0a<p>\x0aThe\x20documentation\x20for\x20the\x20Go\x20standard\x20library.\x0a</p>\x0a\x0a<h3\x20id=\"cmd\"><a\x20href=\"/doc/cmd\">Command\x20Documentation</a></h3>\x0a<p>\x0aThe\x20documentation\x20for\x20the\x20Go\x20tools.\x0a</p>\x0a\x0a<h3\x20id=\"spec\"><a\x20href=\"/ref/spec\">Language\x20Specification</a></h3>\x0a<p>\x0aThe\x20official\x20Go\x20Language\x20specification.\x0a</p>\x0a\x0a<h3\x20id=\"go_mem\"><a\x20href=\"/ref/mem\">The\x20Go\x20Memory\x20Model</a></h3>\x0a<p>\x0aA\x20document\x20that\x20specifies\x20the\x20conditions\x20under\x20which\x20reads\x20of\x20a\x20variable\x20in\x0aone\x20goroutine\x20can\x20be\x20guaranteed\x20to\x20observe\x20values\x20produced\x20by\x20writes\x20to\x20the\x0asame\x20variable\x20in\x20a\x20different\x20goroutine.\x0a</p>\x0a\x0a<h3\x20id=\"release\"><a\x20href=\"/doc/devel/release.html\">Release\x20History</a></h3>\x0a<p>A\x20summary\x20of\x20the\x20changes\x20between\x20Go\x20releases.</p>\x0a\x0a\x0a<h2\x20id=\"articles\">Articles</h2>\x0a\x0a{{if\x20not\x20$.GoogleCN}}\x0a<h3\x20id=\"blog\"><a\x20href=\"//blog.golang.org/\">The\x20Go\x20Blog</a></h3>\x0a<p>The\x20official\x20blog\x20of\x20the\x20Go\x20project,\x20featuring\x20news\x20and\x20in-depth\x20articles\x20by\x0athe\x20Go\x20team\x20and\x20guests.</p>\x0a{{end}}\x0a\x0a<h4>Codewalks</h4>\x0a<p>\x0aGuided\x20tours\x20of\x20Go\x20programs.\x0a</p>\x0a<ul>\x0a<li><a\x20href=\"/doc/codewalk/functions\">First-Class\x20Functions\x20in\x20Go</a></li>\x0a<li><a\x20href=\"/doc/codewalk/markov\">Generating\x20arbitrary\x20text:\x20a\x20Markov\x20chain\x20algorithm</a></li>\x0a<li><a\x20href=\"/doc/codewalk/sharemem\">Share\x20Memory\x20by\x20Communicating</a></li>\x0a<li><a\x20href=\"/doc/articles/wiki/\">Writing\x20Web\x20Applications</a>\x20-\x20building\x20a\x20simple\x20web\x20application.</li>\x0a</ul>\x0a\x0a{{if\x20not\x20$.GoogleCN}}\x0a<h4>Language</h4>\x0a<ul>\x0a<li><a\x20href=\"/blog/json-rpc-tale-of-interfaces\">JSON-RPC:\x20a\x20tale\x20of\x20interfaces</a></li>\x0a<li><a\x20href=\"/blog/gos-declaration-syntax\">Go's\x20Declaration\x20Syntax</a></li>\x0a<li><a\x20href=\"/blog/defer-panic-and-recover\">Defer,\x20Panic,\x20and\x20Recover</a></li>\x0a<li><a\x20href=\"/blog/go-concurrency-patterns-timing-out-and\">Go\x20Concurrency\x20Patterns:\x20Timing\x20out,\x20moving\x20on</a></li>\x0a<li><a\x20href=\"/blog/go-slices-usage-and-internals\">Go\x20Slices:\x20usage\x20and\x20internals</a></li>\x0a<li><a\x20href=\"/blog/gif-decoder-exercise-in-go-interfaces\">A\x20GIF\x20decoder:\x20an\x20exercise\x20in\x20Go\x20interfaces</a></li>\x0a<li><a\x20href=\"/blog/error-handling-and-go\">Error\x20Handling\x20and\x20Go</a></li>\x0a<li><a\x20href=\"/blog/organizing-go-code\">Organizing\x20Go\x20code</a></li>\x0a</ul>\x0a\x0a<h4>Packages</h4>\x0a<ul>\x0a<li><a\x20href=\"/blog/json-and-go\">JSON\x20and\x20Go</a>\x20-\x20using\x20the\x20<a\x20href=\"/pkg/encoding/json/\">json</a>\x20package.</li>\x0a<li><a\x20href=\"/blog/gobs-of-data\">Gobs\x20of\x20data</a>\x20-\x20the\x20design\x20and\x20use\x20of\x20the\x20<a\x20href=\"/pkg/encoding/gob/\">gob</a>\x20package.</li>\x0a<li><a\x20href=\"/blog/laws-of-reflection\">The\x20Laws\x20of\x20Reflection</a>\x20-\x20the\x20fundamentals\x20of\x20the\x20<a\x20href=\"/pkg/reflect/\">reflect</a>\x20package.</li>\x0a<li><a\x20href=\"/blog/go-image-package\">The\x20Go\x20image\x20package</a>\x20-\x20the\x20fundamentals\x20of\x20the\x20<a\x20href=\"/pkg/image/\">image</a>\x20package.</li>\x0a<li><a\x20href=\"/blog/go-imagedraw-package\">The\x20Go\x20image/draw\x20package</a>\x20-\x20the\x20fundamentals\x20of\x20the\x20<a\x20href=\"/pkg/image/draw/\">image/draw</a>\x20package.</li>\x0a</ul>\x0a\x0a<h4>Modules</h4>\x0a<ul>\x0a<li><a\x20href=\"/blog/using-go-modules\">Using\x20Go\x20Modules</a>\x20-\x20an\x20introduction\x20to\x20using\x20modules\x20in\x20a\x20simple\x20project.</li>\x0a<li><a\x20href=\"/blog/migrating-to-go-modules\">Migrating\x20to\x20Go\x20Modules</a>\x20-\x20converting\x20an\x20existing\x20project\x20to\x20use\x20modules.</li>\x0a<li><a\x20href=\"/blog/publishing-go-modules\">Publishing\x20Go\x20Modules</a>\x20-\x20how\x20to\x20make\x20new\x20versions\x20of\x20modules\x20available\x20to\x20others.</li>\x0a<li><a\x20href=\"/blog/v2-go-modules\">Go\x20Modules:\x20v2\x20and\x20Beyond</a>\x20-\x20creating\x20and\x20publishing\x20major\x20versions\x202\x20and\x20higher.</li>\x0a<li><a\x20href=\"/blog/module-compatibility\">Keeping\x20Your\x20Modules\x20Compatible</a>\x20-\x20how\x20to\x20keep\x20your\x20modules\x20compatible\x20with\x20prior\x20minor/patch\x20versions.</li>\x0a</ul>\x0a{{end}}\x0a\x0a<h4>Tools</h4>\x0a<ul>\x0a<li><a\x20href=\"/doc/articles/go_command.html\">About\x20the\x20Go\x20command</a>\x20-\x20why\x20we\x20wrote\x20it,\x20what\x20it\x20is,\x20what\x20it's\x20not,\x20and\x20how\x20to\x20use\x20it.</li>\x0a<li><a\x20href=\"/doc/gdb\">Debugging\x20Go\x20Code\x20with\x20GDB</a></li>\x0a<li><a\x20href=\"/doc/articles/race_detector.html\">Data\x20Race\x20Detector</a>\x20-\x20a\x20manual\x20for\x20the\x20data\x20race\x20detector.</li>\x0a<li><a\x20href=\"/doc/asm\">A\x20Quick\x20Guide\x20to\x20Go's\x20Assembler</a>\x20-\x20an\x20introduction\x20to\x20the\x20assembler\x20used\x20by\x20Go.</li>\x0a{{if\x20not\x20$.GoogleCN}}\x0a<li><a\x20href=\"/blog/c-go-cgo\">C?\x20Go?\x20Cgo!</a>\x20-\x20linking\x20against\x20C\x20code\x20with\x20<a\x20href=\"/cmd/cgo/\">cgo</a>.</li>\x0a<li><a\x20href=\"/blog/godoc-documenting-go-code\">Godoc:\x20documenting\x20Go\x20code</a>\x20-\x20writing\x20good\x20documentation\x20for\x20<a\x20href=\"/cmd/godoc/\">godoc</a>.</li>\x0a<li><a\x20href=\"/blog/profiling-go-programs\">Profiling\x20Go\x20Programs</a></li>\x0a<li><a\x20href=\"/blog/race-detector\">Introducing\x20the\x20Go\x20Race\x20Detector</a>\x20-\x20an\x20introduction\x20to\x20the\x20race\x20detector.</li>\x0a{{end}}\x0a</ul>\x0a\x0a<h4\x20id=\"articles_more\">More</h4>\x0a<p>\x0aSee\x20the\x20<a\x20href=\"/wiki/Articles\">Articles\x20page</a>\x20at\x20the\x0a<a\x20href=\"/wiki\">Wiki</a>\x20for\x20more\x20Go\x20articles.\x0a</p>\x0a\x0a{{if\x20not\x20$.GoogleCN}}\x0a<h2\x20id=\"talks\">Talks</h2>\x0a\x0a<img\x20class=\"gopher\"\x20src=\"/doc/gopher/talks.png\"\x20alt=\"\"/>\x0a\x0a<h3\x20id=\"video_tour_of_go\"><a\x20href=\"https://research.swtch.com/gotour\">A\x20Video\x20Tour\x20of\x20Go</a></h3>\x0a<p>\x0aThree\x20things\x20that\x20make\x20Go\x20fast,\x20fun,\x20and\x20productive:\x0ainterfaces,\x20reflection,\x20and\x20concurrency.\x20Builds\x20a\x20toy\x20web\x20crawler\x20to\x0ademonstrate\x20these.\x0a</p>\x0a\x0a<h3\x20id=\"go_code_that_grows\"><a\x20href=\"//vimeo.com/53221560\">Code\x20that\x20grows\x20with\x20grace</a></h3>\x0a<p>\x0aOne\x20of\x20Go's\x20key\x20design\x20goals\x20is\x20code\x20adaptability;\x20that\x20it\x20should\x20be\x20easy\x20to\x20take\x20a\x20simple\x20design\x20and\x20build\x20upon\x20it\x20in\x20a\x20clean\x20and\x20natural\x20way.\x20In\x20this\x20talk\x20Andrew\x20Gerrand\x20describes\x20a\x20simple\x20\"chat\x20roulette\"\x20server\x20that\x20matches\x20pairs\x20of\x20incoming\x20TCP\x20connections,\x20and\x20then\x20use\x20Go's\x20concurrency\x20mechanisms,\x20interfaces,\x20and\x20standard\x20library\x20to\x20extend\x20it\x20with\x20a\x20web\x20interface\x20and\x20other\x20features.\x20While\x20the\x20function\x20of\x20the\x20program\x20changes\x20dramatically,\x20Go's\x20flexibility\x20preserves\x20the\x20original\x20design\x20as\x20it\x20grows.\x0a</p>\x0a\x0a<h3\x20id=\"go_concurrency_patterns\"><a\x20href=\"//www.youtube.com/watch?v=f6kdp27TYZs\">Go\x20Concurrency\x20Patterns</a></h3>\x0a<p>\x0aConcurrency\x20is\x20the\x20key\x20to\x20designing\x20high\x20performance\x20network\x20services.\x20Go's\x20concurrency\x20primitives\x20(goroutines\x20and\x20channels)\x20provide\x20a\x20simple\x20and\x20efficient\x20means\x20of\x20expressing\x20concurrent\x20execution.\x20In\x20this\x20talk\x20we\x20see\x20how\x20tricky\x20concurrency\x20problems\x20can\x20be\x20solved\x20gracefully\x20with\x20simple\x20Go\x20code.\x0a</p>\x0a\x0a<h3\x20id=\"advanced_go_concurrency_patterns\"><a\x20href=\"//www.youtube.com/watch?v=QDDwwePbDtw\">Advanced\x20Go\x20Concurrency\x20Patterns</a></h3>\x0a<p>\x0aThis\x20talk\x20expands\x20on\x20the\x20<i>Go\x20Concurrency\x20Patterns</i>\x20talk\x20to\x20dive\x20deeper\x20into\x20Go's\x20concurrency\x20primitives.\x0a</p>\x0a\x0a<h4\x20id=\"talks_more\">More</h4>\x0a<p>\x0aSee\x20the\x20<a\x20href=\"/talks\">Go\x20Talks\x20site</a>\x20and\x20<a\x20href=\"/wiki/GoTalks\">wiki\x20page</a>\x20for\x20more\x20Go\x20talks.\x0a</p>\x0a{{end}}\x0a\x0a<h2\x20id=\"nonenglish\">Non-English\x20Documentation</h2>\x0a\x0a<p>\x0aSee\x20the\x20<a\x20href=\"/wiki/NonEnglish\">NonEnglish</a>\x20page\x0aat\x20the\x20<a\x20href=\"/wiki\">Wiki</a>\x20for\x20localized\x0adocumentation.\x0a</p>\x0a",
 
-	"doc/download.js": "class\x20DownloadsController\x20{\x0a\x20\x20constructor()\x20{\x0a\x20\x20\x20\x20//\x20Parts\x20of\x20tabbed\x20section.\x0a\x20\x20\x20\x20this.tablist\x20=\x20document.querySelector('.js-tabSection');\x0a\x20\x20\x20\x20this.tabs\x20=\x20this.tablist.querySelectorAll('[role=\"tab\"]');\x0a\x20\x20\x20\x20this.panels\x20=\x20document.querySelectorAll('[role=\"tabpanel\"]');\x0a\x0a\x20\x20\x20\x20//\x20OS\x20for\x20which\x20to\x20display\x20download\x20and\x20install\x20steps.\x0a\x20\x20\x20\x20this.osName\x20=\x20'Unknown\x20OS';\x0a\x0a\x20\x20\x20\x20//\x20URL\x20to\x20JSON\x20containing\x20list\x20of\x20installer\x20downloads.\x0a\x20\x20\x20\x20const\x20fileListUrl\x20=\x20'https://golang.org/dl/?mode=json';\x0a\x20\x20\x20\x20this.activeTabIndex\x20=\x200;\x0a\x0a\x20\x20\x20\x20//\x20Get\x20the\x20install\x20file\x20list,\x20then\x20get\x20names\x20and\x20sizes\x0a\x20\x20\x20\x20//\x20for\x20each\x20OS\x20supported\x20on\x20the\x20install\x20page.\x0a\x20\x20\x20\x20fetch(fileListUrl)\x0a\x20\x20\x20\x20\x20\x20.then((response)\x20=>\x20response.json())\x0a\x20\x20\x20\x20\x20\x20.then((data)\x20=>\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20const\x20files\x20=\x20data[0]['files'];\x0a\x20\x20\x20\x20\x20\x20\x20\x20for\x20(var\x20i\x20=\x200;\x20i\x20<\x20files.length;\x20i++)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20let\x20file\x20=\x20files[i].filename;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20let\x20fileSize\x20=\x20files[i].size;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20if\x20(file.match('.linux-amd64.tar.gz$'))\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20this.linuxFileName\x20=\x20file;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20this.linuxFileSize\x20=\x20Math.round(fileSize\x20/\x20Math.pow(1024,\x202));\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20if\x20(file.match('.darwin-amd64(-osx10.8)?.pkg$'))\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20this.macFileName\x20=\x20file;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20this.macFileSize\x20=\x20Math.round(fileSize\x20/\x20Math.pow(1024,\x202));\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20if\x20(file.match('.windows-amd64.msi$'))\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20this.windowsFileName\x20=\x20file;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20this.windowsFileSize\x20=\x20Math.round(fileSize\x20/\x20Math.pow(1024,\x202));\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20this.detectOS();\x0a\x20\x20\x20\x20\x20\x20\x20\x20document.getElementById(this.osName).click();\x0a\x20\x20\x20\x20\x20\x20\x20\x20this.setDownloadForOS(this.osName);\x0a\x20\x20\x20\x20\x20\x20})\x0a\x20\x20\x20\x20\x20\x20.catch(console.error);\x0a\x20\x20\x20\x20\x20\x20this.setEventListeners();\x0a\x20\x20}\x0a\x0a\x20\x20setEventListeners()\x20{\x0a\x20\x20\x20\x20this.tabs.forEach((tabEl)\x20=>\x20{\x0a\x20\x20\x20\x20\x20\x20tabEl.addEventListener('click',\x20e\x20=>\x20this.handleTabClick((e)));\x0a\x20\x20\x20\x20});\x0a\x20\x20}\x0a\x0a\x20\x20//\x20Set\x20the\x20download\x20button\x20UI\x20for\x20a\x20specific\x20OS.\x0a\x20\x20setDownloadForOS(osName)\x20{\x0a\x20\x20\x20\x20const\x20baseURL\x20=\x20'https://golang.org/dl/';\x0a\x20\x20\x20\x20let\x20download;\x0a\x0a\x20\x20\x20\x20switch(osName){\x0a\x20\x20\x20\x20\x20\x20case\x20'linux':\x0a\x20\x20\x20\x20\x20\x20\x20\x20document.querySelector('.js-downloadButton').textContent\x20=\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'Download\x20Go\x20for\x20Linux';\x0a\x20\x20\x20\x20\x20\x20\x20\x20document.querySelector('.js-downloadDescription').textContent\x20=\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20this.linuxFileName\x20+\x20'\x20('\x20+\x20this.linuxFileSize\x20+\x20'\x20MB)';\x0a\x20\x20\x20\x20\x20\x20\x20\x20document.querySelector('.js-download').href\x20=\x20baseURL\x20+\x20this.linuxFileName;\x0a\x20\x20\x20\x20\x20\x20\x20\x20break;\x0a\x20\x20\x20\x20\x20\x20case\x20'mac':\x0a\x20\x20\x20\x20\x20\x20\x20\x20document.querySelector('.js-downloadButton').textContent\x20=\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'Download\x20Go\x20for\x20Mac';\x0a\x20\x20\x20\x20\x20\x20\x20\x20document.querySelector('.js-downloadDescription').textContent\x20=\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20this.macFileName\x20+\x20'\x20('\x20+\x20this.macFileSize\x20+\x20'\x20MB)';\x0a\x20\x20\x20\x20\x20\x20\x20\x20document.querySelector('.js-download').href\x20=\x20baseURL\x20+\x20this.macFileName;\x0a\x20\x20\x20\x20\x20\x20\x20\x20break;\x0a\x20\x20\x20\x20\x20\x20case\x20'windows':\x0a\x20\x20\x20\x20\x20\x20\x20\x20document.querySelector('.js-downloadButton').textContent\x20=\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'Download\x20Go\x20for\x20Windows';\x0a\x20\x20\x20\x20\x20\x20\x20\x20document.querySelector('.js-downloadDescription').textContent\x20=\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20this.windowsFileName\x20+\x20'\x20('\x20+\x20this.windowsFileSize\x20+\x20'\x20MB)';\x0a\x20\x20\x20\x20\x20\x20\x20\x20document.querySelector('.js-download').href\x20=\x20baseURL\x20+\x20this.windowsFileName;\x0a\x20\x20\x20\x20\x20\x20\x20\x20break;\x0a\x20\x20\x20\x20\x20\x20default:\x0a\x20\x20\x20\x20\x20\x20\x20\x20document.querySelector('.js-downloadButton').textContent\x20=\x20'Download\x20Go';\x0a\x20\x20\x20\x20\x20\x20\x20\x20document.querySelector('.js-downloadDescription').textContent\x20=\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'Visit\x20the\x20downloads\x20page.';\x0a\x20\x20\x20\x20\x20\x20\x20\x20document.querySelector('.js-download').href\x20=\x20baseURL;\x0a\x20\x20\x20\x20\x20\x20\x20\x20break;\x0a\x20\x20\x20\x20}\x0a\x20\x20}\x0a\x0a\x20\x20//\x20Detect\x20the\x20users\x20OS\x20for\x20installation\x20default.\x0a\x20\x20detectOS()\x20{\x0a\x20\x20\x20\x20if\x20(navigator.appVersion.indexOf('Linux')\x20!==\x20-1)\x20{\x0a\x20\x20\x20\x20\x20\x20this.osName\x20=\x20'linux';\x0a\x20\x20\x20\x20}\x0a\x20\x20\x20\x20if\x20(navigator.appVersion.indexOf('Mac')\x20!==\x20-1)\x20{\x0a\x20\x20\x20\x20\x20\x20this.osName\x20=\x20'mac';\x0a\x20\x20\x20\x20}\x0a\x20\x20\x20\x20if\x20(navigator.appVersion.indexOf('X11')\x20!==\x20-1)\x20{\x0a\x20\x20\x20\x20\x20\x20this.osName\x20=\x20'unix';\x0a\x20\x20\x20\x20}\x0a\x20\x20\x20\x20if\x20(navigator.appVersion.indexOf('Win')\x20!==\x20-1)\x20{\x0a\x20\x20\x20\x20\x20\x20this.osName\x20=\x20'windows';\x0a\x20\x20\x20\x20}\x0a\x20\x20}\x0a\x0a\x20\x20//\x20Activates\x20the\x20tab\x20at\x20the\x20given\x20index.\x0a\x20\x20activateTab(index)\x20{\x0a\x20\x20\x20\x20this.tabs[this.activeTabIndex].setAttribute('aria-selected',\x20'false');\x0a\x20\x20\x20\x20this.tabs[this.activeTabIndex].setAttribute('tabindex',\x20'-1');\x0a\x20\x20\x20\x20this.panels[this.activeTabIndex].setAttribute('hidden',\x20'');\x0a\x20\x20\x20\x20this.tabs[index].setAttribute('aria-selected',\x20'true');\x0a\x20\x20\x20\x20this.tabs[index].setAttribute('tabindex',\x20'0');\x0a\x20\x20\x20\x20this.panels[index].removeAttribute('hidden');\x0a\x20\x20\x20\x20this.tabs[index].focus();\x0a\x20\x20\x20\x20this.activeTabIndex\x20=\x20index;\x0a\x20\x20}\x0a\x0a\x20\x20//\x20Handles\x20clicks\x20on\x20tabs.\x0a\x20\x20handleTabClick(e)\x20{\x0a\x20\x20\x20\x20const\x20el\x20=\x20(e.target);\x0a\x20\x20\x20\x20this.activateTab(Array.prototype.indexOf.call(this.tabs,\x20el));\x0a\x20\x20\x20\x20this.setDownloadForOS(el.id);\x0a\x20\x20}\x0a\x0a}\x0a\x0a//\x20Instantiate\x20controller\x20for\x20page\x20event\x20handling.\x0anew\x20DownloadsController();\x0a",
+	"doc/download.js": "class\x20DownloadsController\x20{\x0a\x20\x20constructor()\x20{\x0a\x20\x20\x20\x20//\x20Parts\x20of\x20tabbed\x20section.\x0a\x20\x20\x20\x20this.tablist\x20=\x20document.querySelector('.js-tabSection');\x0a\x20\x20\x20\x20this.tabs\x20=\x20this.tablist.querySelectorAll('[role=\"tab\"]');\x0a\x20\x20\x20\x20this.panels\x20=\x20document.querySelectorAll('[role=\"tabpanel\"]');\x0a\x0a\x20\x20\x20\x20//\x20OS\x20for\x20which\x20to\x20display\x20download\x20and\x20install\x20steps.\x0a\x20\x20\x20\x20this.osName\x20=\x20'Unknown\x20OS';\x0a\x0a\x20\x20\x20\x20//\x20URL\x20to\x20JSON\x20containing\x20list\x20of\x20installer\x20downloads.\x0a\x20\x20\x20\x20const\x20fileListUrl\x20=\x20'https://golang.org/dl/?mode=json';\x0a\x20\x20\x20\x20this.activeTabIndex\x20=\x200;\x0a\x0a\x20\x20\x20\x20//\x20Get\x20the\x20install\x20file\x20list,\x20then\x20get\x20names\x20and\x20sizes\x0a\x20\x20\x20\x20//\x20for\x20each\x20OS\x20supported\x20on\x20the\x20install\x20page.\x0a\x20\x20\x20\x20fetch(fileListUrl)\x0a\x20\x20\x20\x20\x20\x20.then((response)\x20=>\x20response.json())\x0a\x20\x20\x20\x20\x20\x20.then((data)\x20=>\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20const\x20files\x20=\x20data[0]['files'];\x0a\x20\x20\x20\x20\x20\x20\x20\x20for\x20(var\x20i\x20=\x200;\x20i\x20<\x20files.length;\x20i++)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20let\x20file\x20=\x20files[i].filename;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20let\x20fileSize\x20=\x20files[i].size;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20if\x20(file.match('.linux-amd64.tar.gz$'))\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20this.linuxFileName\x20=\x20file;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20this.linuxFileSize\x20=\x20Math.round(fileSize\x20/\x20Math.pow(1024,\x202));\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20if\x20(file.match('.darwin-amd64(-osx10.8)?.pkg$'))\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20this.macFileName\x20=\x20file;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20this.macFileSize\x20=\x20Math.round(fileSize\x20/\x20Math.pow(1024,\x202));\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20if\x20(file.match('.windows-amd64.msi$'))\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20this.windowsFileName\x20=\x20file;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20this.windowsFileSize\x20=\x20Math.round(fileSize\x20/\x20Math.pow(1024,\x202));\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20this.detectOS();\x0a\x20\x20\x20\x20\x20\x20\x20\x20document.getElementById(this.osName).click();\x0a\x20\x20\x20\x20\x20\x20\x20\x20this.setDownloadForOS(this.osName);\x0a\x20\x20\x20\x20\x20\x20})\x0a\x20\x20\x20\x20\x20\x20.catch(console.error);\x0a\x20\x20\x20\x20\x20\x20this.setEventListeners();\x0a\x20\x20}\x0a\x0a\x20\x20setEventListeners()\x20{\x0a\x20\x20\x20\x20this.tabs.forEach((tabEl)\x20=>\x20{\x0a\x20\x20\x20\x20\x20\x20tabEl.addEventListener('click',\x20e\x20=>\x20this.handleTabClick((e)));\x0a\x20\x20\x20\x20});\x0a\x20\x20}\x0a\x0a\x20\x20//\x20Set\x20the\x20download\x20button\x20UI\x20for\x20a\x20specific\x20OS.\x0a\x20\x20setDownloadForOS(osName)\x20{\x0a\x20\x20\x20\x20const\x20baseURL\x20=\x20'https://golang.org/dl/';\x0a\x20\x20\x20\x20let\x20download;\x0a\x0a\x20\x20\x20\x20switch(osName){\x0a\x20\x20\x20\x20\x20\x20case\x20'linux':\x0a\x20\x20\x20\x20\x20\x20\x20\x20document.querySelector('.js-downloadButton').textContent\x20=\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'Download\x20Go\x20for\x20Linux';\x0a\x20\x20\x20\x20\x20\x20\x20\x20document.querySelector('.js-downloadDescription').textContent\x20=\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20this.linuxFileName\x20+\x20'\x20('\x20+\x20this.linuxFileSize\x20+\x20'\x20MB)';\x0a\x20\x20\x20\x20\x20\x20\x20\x20document.querySelector('.js-download').href\x20=\x20baseURL\x20+\x20this.linuxFileName;\x0a\x20\x20\x20\x20\x20\x20\x20\x20break;\x0a\x20\x20\x20\x20\x20\x20case\x20'mac':\x0a\x20\x20\x20\x20\x20\x20\x20\x20document.querySelector('.js-downloadButton').textContent\x20=\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'Download\x20Go\x20for\x20Mac';\x0a\x20\x20\x20\x20\x20\x20\x20\x20document.querySelector('.js-downloadDescription').textContent\x20=\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20this.macFileName\x20+\x20'\x20('\x20+\x20this.macFileSize\x20+\x20'\x20MB)';\x0a\x20\x20\x20\x20\x20\x20\x20\x20document.querySelector('.js-download').href\x20=\x20baseURL\x20+\x20this.macFileName;\x0a\x20\x20\x20\x20\x20\x20\x20\x20break;\x0a\x20\x20\x20\x20\x20\x20case\x20'windows':\x0a\x20\x20\x20\x20\x20\x20\x20\x20document.querySelector('.js-downloadButton').textContent\x20=\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'Download\x20Go\x20for\x20Windows';\x0a\x20\x20\x20\x20\x20\x20\x20\x20document.querySelector('.js-downloadDescription').textContent\x20=\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20this.windowsFileName\x20+\x20'\x20('\x20+\x20this.windowsFileSize\x20+\x20'\x20MB)';\x0a\x20\x20\x20\x20\x20\x20\x20\x20document.querySelector('.js-download').href\x20=\x20baseURL\x20+\x20this.windowsFileName;\x0a\x20\x20\x20\x20\x20\x20\x20\x20break;\x0a\x20\x20\x20\x20\x20\x20default:\x0a\x20\x20\x20\x20\x20\x20\x20\x20document.querySelector('.js-downloadButton').textContent\x20=\x20'Download\x20Go';\x0a\x20\x20\x20\x20\x20\x20\x20\x20document.querySelector('.js-downloadDescription').textContent\x20=\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'Visit\x20the\x20downloads\x20page.';\x0a\x20\x20\x20\x20\x20\x20\x20\x20document.querySelector('.js-download').href\x20=\x20baseURL;\x0a\x20\x20\x20\x20\x20\x20\x20\x20break;\x0a\x20\x20\x20\x20}\x0a\x20\x20}\x0a\x0a\x20\x20//\x20Updates\x20install\x20tab\x20with\x20dynamic\x20data.\x0a\x20\x20setInstallTabData(osName)\x20{\x0a\x20\x20\x20\x20const\x20fnId\x20=\x20`#${osName}-filename`;\x0a\x20\x20\x20\x20const\x20el\x20=\x20document.querySelector(fnId);\x0a\x20\x20\x20\x20if\x20(!el)\x20{\x0a\x20\x20\x20\x20\x20\x20return;\x0a\x20\x20\x20\x20}\x0a\x20\x20\x20\x20switch(osName)\x20{\x0a\x20\x20\x20\x20\x20\x20case\x20'linux':\x0a\x20\x20\x20\x20\x20\x20\x20\x20//\x20Update\x20filename\x20for\x20linux\x20installation\x20step\x0a\x20\x20\x20\x20\x20\x20\x20\x20if\x20(this.linuxFileName)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20el.textContent\x20=\x20this.linuxFileName;\x0a\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20break;\x0a\x20\x20\x20\x20}\x0a\x20\x20}\x0a\x0a\x20\x20//\x20Detect\x20the\x20users\x20OS\x20for\x20installation\x20default.\x0a\x20\x20detectOS()\x20{\x0a\x20\x20\x20\x20if\x20(navigator.appVersion.indexOf('Linux')\x20!==\x20-1)\x20{\x0a\x20\x20\x20\x20\x20\x20this.osName\x20=\x20'linux';\x0a\x20\x20\x20\x20}\x0a\x20\x20\x20\x20if\x20(navigator.appVersion.indexOf('Mac')\x20!==\x20-1)\x20{\x0a\x20\x20\x20\x20\x20\x20this.osName\x20=\x20'mac';\x0a\x20\x20\x20\x20}\x0a\x20\x20\x20\x20if\x20(navigator.appVersion.indexOf('X11')\x20!==\x20-1)\x20{\x0a\x20\x20\x20\x20\x20\x20this.osName\x20=\x20'unix';\x0a\x20\x20\x20\x20}\x0a\x20\x20\x20\x20if\x20(navigator.appVersion.indexOf('Win')\x20!==\x20-1)\x20{\x0a\x20\x20\x20\x20\x20\x20this.osName\x20=\x20'windows';\x0a\x20\x20\x20\x20}\x0a\x20\x20}\x0a\x0a\x20\x20//\x20Activates\x20the\x20tab\x20at\x20the\x20given\x20index.\x0a\x20\x20activateTab(index)\x20{\x0a\x20\x20\x20\x20this.tabs[this.activeTabIndex].setAttribute('aria-selected',\x20'false');\x0a\x20\x20\x20\x20this.tabs[this.activeTabIndex].setAttribute('tabindex',\x20'-1');\x0a\x20\x20\x20\x20this.panels[this.activeTabIndex].setAttribute('hidden',\x20'');\x0a\x20\x20\x20\x20this.tabs[index].setAttribute('aria-selected',\x20'true');\x0a\x20\x20\x20\x20this.tabs[index].setAttribute('tabindex',\x20'0');\x0a\x20\x20\x20\x20this.panels[index].removeAttribute('hidden');\x0a\x20\x20\x20\x20this.tabs[index].focus();\x0a\x20\x20\x20\x20this.activeTabIndex\x20=\x20index;\x0a\x20\x20}\x0a\x0a\x20\x20//\x20Handles\x20clicks\x20on\x20tabs.\x0a\x20\x20handleTabClick(e)\x20{\x0a\x20\x20\x20\x20const\x20el\x20=\x20(e.target);\x0a\x20\x20\x20\x20this.activateTab(Array.prototype.indexOf.call(this.tabs,\x20el));\x0a\x20\x20\x20\x20this.setDownloadForOS(el.id);\x0a\x20\x20\x20\x20this.setInstallTabData(el.id);\x0a\x20\x20}\x0a\x0a}\x0a\x0a//\x20Instantiate\x20controller\x20for\x20page\x20event\x20handling.\x0anew\x20DownloadsController();\x0a",
 
 	"doc/gopath_code.html": "<!--{\x0a\x09\"Title\":\x20\"How\x20to\x20Write\x20Go\x20Code\x20(with\x20GOPATH)\"\x0a}-->\x0a\x0a<h2\x20id=\"Introduction\">Introduction</h2>\x0a\x0a<p><b>\x0aIf\x20you\x20are\x20new\x20to\x20Go,\x20please\x20see\x20the\x20more\x20recent\x0a<a\x20href=\"code.html\">How\x20to\x20Write\x20Go\x20Code</a>.\x0a</b></p>\x0a\x0a<p>\x0aThis\x20document\x20demonstrates\x20the\x20development\x20of\x20a\x20simple\x20Go\x20package\x20and\x0aintroduces\x20the\x20<a\x20href=\"/cmd/go/\">go\x20tool</a>,\x20the\x20standard\x20way\x20to\x20fetch,\x0abuild,\x20and\x20install\x20Go\x20packages\x20and\x20commands.\x0a</p>\x0a\x0a<p>\x0aThe\x20<code>go</code>\x20tool\x20requires\x20you\x20to\x20organize\x20your\x20code\x20in\x20a\x20specific\x0away.\x20Please\x20read\x20this\x20document\x20carefully.\x0aIt\x20explains\x20the\x20simplest\x20way\x20to\x20get\x20up\x20and\x20running\x20with\x20your\x20Go\x20installation.\x0a</p>\x0a\x0a<p>\x0aA\x20similar\x20explanation\x20is\x20available\x20as\x20a\x0a<a\x20href=\"//www.youtube.com/watch?v=XCsL89YtqCs\">screencast</a>.\x0a</p>\x0a\x0a\x0a<h2\x20id=\"Organization\">Code\x20organization</h2>\x0a\x0a<h3\x20id=\"Overview\">Overview</h3>\x0a\x0a<ul>\x0a\x09<li>Go\x20programmers\x20typically\x20keep\x20all\x20their\x20Go\x20code\x20in\x20a\x20single\x20<i>workspace</i>.</li>\x0a\x09<li>A\x20workspace\x20contains\x20many\x20version\x20control\x20<i>repositories</i>\x0a\x09\x20\x20\x20\x20(managed\x20by\x20Git,\x20for\x20example).</li>\x0a\x09<li>Each\x20repository\x20contains\x20one\x20or\x20more\x20<i>packages</i>.</li>\x0a\x09<li>Each\x20package\x20consists\x20of\x20one\x20or\x20more\x20Go\x20source\x20files\x20in\x20a\x20single\x20directory.</li>\x0a\x09<li>The\x20path\x20to\x20a\x20package's\x20directory\x20determines\x20its\x20<i>import\x20path</i>.</li>\x0a</ul>\x0a\x0a<p>\x0aNote\x20that\x20this\x20differs\x20from\x20other\x20programming\x20environments\x20in\x20which\x20every\x0aproject\x20has\x20a\x20separate\x20workspace\x20and\x20workspaces\x20are\x20closely\x20tied\x20to\x20version\x0acontrol\x20repositories.\x0a</p>\x0a\x0a<h3\x20id=\"Workspaces\">Workspaces</h3>\x0a\x0a<p>\x0aA\x20workspace\x20is\x20a\x20directory\x20hierarchy\x20with\x20two\x20directories\x20at\x20its\x20root:\x0a</p>\x0a\x0a<ul>\x0a<li><code>src</code>\x20contains\x20Go\x20source\x20files,\x20and\x0a<li><code>bin</code>\x20contains\x20executable\x20commands.\x0a</ul>\x0a\x0a<p>\x0aThe\x20<code>go</code>\x20tool\x20builds\x20and\x20installs\x20binaries\x20to\x20the\x20<code>bin</code>\x20directory.\x0a</p>\x0a\x0a<p>\x0aThe\x20<code>src</code>\x20subdirectory\x20typically\x20contains\x20multiple\x20version\x20control\x0arepositories\x20(such\x20as\x20for\x20Git\x20or\x20Mercurial)\x20that\x20track\x20the\x20development\x20of\x20one\x0aor\x20more\x20source\x20packages.\x0a</p>\x0a\x0a<p>\x0aTo\x20give\x20you\x20an\x20idea\x20of\x20how\x20a\x20workspace\x20looks\x20in\x20practice,\x20here's\x20an\x20example:\x0a</p>\x0a\x0a<pre>\x0abin/\x0a\x20\x20\x20\x20hello\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20command\x20executable\x0a\x20\x20\x20\x20outyet\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20command\x20executable\x0asrc/\x0a\x20\x20\x20\x20<a\x20href=\"https://github.com/golang/example/\">github.com/golang/example/</a>\x0a\x20\x20\x20\x20\x20\x20\x20\x20.git/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Git\x20repository\x20metadata\x0a\x09hello/\x0a\x09\x20\x20\x20\x20hello.go\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20command\x20source\x0a\x09outyet/\x0a\x09\x20\x20\x20\x20main.go\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20command\x20source\x0a\x09\x20\x20\x20\x20main_test.go\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20test\x20source\x0a\x09stringutil/\x0a\x09\x20\x20\x20\x20reverse.go\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20package\x20source\x0a\x09\x20\x20\x20\x20reverse_test.go\x20\x20\x20\x20\x20\x20\x20\x20#\x20test\x20source\x0a\x20\x20\x20\x20<a\x20href=\"https://golang.org/x/image/\">golang.org/x/image/</a>\x0a\x20\x20\x20\x20\x20\x20\x20\x20.git/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Git\x20repository\x20metadata\x0a\x09bmp/\x0a\x09\x20\x20\x20\x20reader.go\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20package\x20source\x0a\x09\x20\x20\x20\x20writer.go\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20package\x20source\x0a\x20\x20\x20\x20...\x20(many\x20more\x20repositories\x20and\x20packages\x20omitted)\x20...\x0a</pre>\x0a\x0a<p>\x0aThe\x20tree\x20above\x20shows\x20a\x20workspace\x20containing\x20two\x20repositories\x0a(<code>example</code>\x20and\x20<code>image</code>).\x0aThe\x20<code>example</code>\x20repository\x20contains\x20two\x20commands\x20(<code>hello</code>\x0aand\x20<code>outyet</code>)\x20and\x20one\x20library\x20(<code>stringutil</code>).\x0aThe\x20<code>image</code>\x20repository\x20contains\x20the\x20<code>bmp</code>\x20package\x0aand\x20<a\x20href=\"https://godoc.org/golang.org/x/image\">several\x20others</a>.\x0a</p>\x0a\x0a<p>\x0aA\x20typical\x20workspace\x20contains\x20many\x20source\x20repositories\x20containing\x20many\x0apackages\x20and\x20commands.\x20Most\x20Go\x20programmers\x20keep\x20<i>all</i>\x20their\x20Go\x20source\x20code\x0aand\x20dependencies\x20in\x20a\x20single\x20workspace.\x0a</p>\x0a\x0a<p>\x0aNote\x20that\x20symbolic\x20links\x20should\x20<b>not</b>\x20be\x20used\x20to\x20link\x20files\x20or\x20directories\x20into\x20your\x20workspace.\x0a</p>\x0a\x0a<p>\x0aCommands\x20and\x20libraries\x20are\x20built\x20from\x20different\x20kinds\x20of\x20source\x20packages.\x0aWe\x20will\x20discuss\x20the\x20distinction\x20<a\x20href=\"#PackageNames\">later</a>.\x0a</p>\x0a\x0a\x0a<h3\x20id=\"GOPATH\">The\x20<code>GOPATH</code>\x20environment\x20variable</h3>\x0a\x0a<p>\x0aThe\x20<code>GOPATH</code>\x20environment\x20variable\x20specifies\x20the\x20location\x20of\x20your\x0aworkspace.\x20It\x20defaults\x20to\x20a\x20directory\x20named\x20<code>go</code>\x20inside\x20your\x20home\x20directory,\x0aso\x20<code>$HOME/go</code>\x20on\x20Unix,\x0a<code>$home/go</code>\x20on\x20Plan\x209,\x0aand\x20<code>%USERPROFILE%\\go</code>\x20(usually\x20<code>C:\\Users\\YourName\\go</code>)\x20on\x20Windows.\x0a</p>\x0a\x0a<p>\x0aIf\x20you\x20would\x20like\x20to\x20work\x20in\x20a\x20different\x20location,\x20you\x20will\x20need\x20to\x0a<a\x20href=\"https://golang.org/wiki/SettingGOPATH\">set\x20<code>GOPATH</code></a>\x0ato\x20the\x20path\x20to\x20that\x20directory.\x0a(Another\x20common\x20setup\x20is\x20to\x20set\x20<code>GOPATH=$HOME</code>.)\x0aNote\x20that\x20<code>GOPATH</code>\x20must\x20<b>not</b>\x20be\x20the\x0asame\x20path\x20as\x20your\x20Go\x20installation.\x0a</p>\x0a\x0a<p>\x0aThe\x20command\x20<code>go</code>\x20<code>env</code>\x20<code>GOPATH</code>\x0aprints\x20the\x20effective\x20current\x20<code>GOPATH</code>;\x0ait\x20prints\x20the\x20default\x20location\x20if\x20the\x20environment\x20variable\x20is\x20unset.\x0a</p>\x0a\x0a<p>\x0aFor\x20convenience,\x20add\x20the\x20workspace's\x20<code>bin</code>\x20subdirectory\x0ato\x20your\x20<code>PATH</code>:\x0a</p>\x0a\x0a<pre>\x0a$\x20<b>export\x20PATH=$PATH:$(go\x20env\x20GOPATH)/bin</b>\x0a</pre>\x0a\x0a<p>\x0aThe\x20scripts\x20in\x20the\x20rest\x20of\x20this\x20document\x20use\x20<code>$GOPATH</code>\x0ainstead\x20of\x20<code>$(go\x20env\x20GOPATH)</code>\x20for\x20brevity.\x0aTo\x20make\x20the\x20scripts\x20run\x20as\x20written\x0aif\x20you\x20have\x20not\x20set\x20GOPATH,\x0ayou\x20can\x20substitute\x20$HOME/go\x20in\x20those\x20commands\x0aor\x20else\x20run:\x0a</p>\x0a\x0a<pre>\x0a$\x20<b>export\x20GOPATH=$(go\x20env\x20GOPATH)</b>\x0a</pre>\x0a\x0a<p>\x0aTo\x20learn\x20more\x20about\x20the\x20<code>GOPATH</code>\x20environment\x20variable,\x20see\x0a<a\x20href=\"/cmd/go/#hdr-GOPATH_environment_variable\"><code>'go\x20help\x20gopath'</code></a>.\x0a</p>\x0a\x0a<h3\x20id=\"ImportPaths\">Import\x20paths</h3>\x0a\x0a<p>\x0aAn\x20<i>import\x20path</i>\x20is\x20a\x20string\x20that\x20uniquely\x20identifies\x20a\x20package.\x0aA\x20package's\x20import\x20path\x20corresponds\x20to\x20its\x20location\x20inside\x20a\x20workspace\x0aor\x20in\x20a\x20remote\x20repository\x20(explained\x20below).\x0a</p>\x0a\x0a<p>\x0aThe\x20packages\x20from\x20the\x20standard\x20library\x20are\x20given\x20short\x20import\x20paths\x20such\x20as\x0a<code>\"fmt\"</code>\x20and\x20<code>\"net/http\"</code>.\x0aFor\x20your\x20own\x20packages,\x20you\x20must\x20choose\x20a\x20base\x20path\x20that\x20is\x20unlikely\x20to\x0acollide\x20with\x20future\x20additions\x20to\x20the\x20standard\x20library\x20or\x20other\x20external\x0alibraries.\x0a</p>\x0a\x0a<p>\x0aIf\x20you\x20keep\x20your\x20code\x20in\x20a\x20source\x20repository\x20somewhere,\x20then\x20you\x20should\x20use\x20the\x0aroot\x20of\x20that\x20source\x20repository\x20as\x20your\x20base\x20path.\x0aFor\x20instance,\x20if\x20you\x20have\x20a\x20<a\x20href=\"https://github.com/\">GitHub</a>\x20account\x20at\x0a<code>github.com/user</code>,\x20that\x20should\x20be\x20your\x20base\x20path.\x0a</p>\x0a\x0a<p>\x0aNote\x20that\x20you\x20don't\x20need\x20to\x20publish\x20your\x20code\x20to\x20a\x20remote\x20repository\x20before\x20you\x0acan\x20build\x20it.\x20It's\x20just\x20a\x20good\x20habit\x20to\x20organize\x20your\x20code\x20as\x20if\x20you\x20will\x0apublish\x20it\x20someday.\x20In\x20practice\x20you\x20can\x20choose\x20any\x20arbitrary\x20path\x20name,\x0aas\x20long\x20as\x20it\x20is\x20unique\x20to\x20the\x20standard\x20library\x20and\x20greater\x20Go\x20ecosystem.\x0a</p>\x0a\x0a<p>\x0aWe'll\x20use\x20<code>github.com/user</code>\x20as\x20our\x20base\x20path.\x20Create\x20a\x20directory\x0ainside\x20your\x20workspace\x20in\x20which\x20to\x20keep\x20source\x20code:\x0a</p>\x0a\x0a<pre>\x0a$\x20<b>mkdir\x20-p\x20$GOPATH/src/github.com/user</b>\x0a</pre>\x0a\x0a\x0a<h3\x20id=\"Command\">Your\x20first\x20program</h3>\x0a\x0a<p>\x0aTo\x20compile\x20and\x20run\x20a\x20simple\x20program,\x20first\x20choose\x20a\x20package\x20path\x20(we'll\x20use\x0a<code>github.com/user/hello</code>)\x20and\x20create\x20a\x20corresponding\x20package\x20directory\x0ainside\x20your\x20workspace:\x0a</p>\x0a\x0a<pre>\x0a$\x20<b>mkdir\x20$GOPATH/src/github.com/user/hello</b>\x0a</pre>\x0a\x0a<p>\x0aNext,\x20create\x20a\x20file\x20named\x20<code>hello.go</code>\x20inside\x20that\x20directory,\x0acontaining\x20the\x20following\x20Go\x20code.\x0a</p>\x0a\x0a<pre>\x0apackage\x20main\x0a\x0aimport\x20\"fmt\"\x0a\x0afunc\x20main()\x20{\x0a\x09fmt.Println(\"Hello,\x20world.\")\x0a}\x0a</pre>\x0a\x0a<p>\x0aNow\x20you\x20can\x20build\x20and\x20install\x20that\x20program\x20with\x20the\x20<code>go</code>\x20tool:\x0a</p>\x0a\x0a<pre>\x0a$\x20<b>go\x20install\x20github.com/user/hello</b>\x0a</pre>\x0a\x0a<p>\x0aNote\x20that\x20you\x20can\x20run\x20this\x20command\x20from\x20anywhere\x20on\x20your\x20system.\x20The\x0a<code>go</code>\x20tool\x20finds\x20the\x20source\x20code\x20by\x20looking\x20for\x20the\x0a<code>github.com/user/hello</code>\x20package\x20inside\x20the\x20workspace\x20specified\x20by\x0a<code>GOPATH</code>.\x0a</p>\x0a\x0a<p>\x0aYou\x20can\x20also\x20omit\x20the\x20package\x20path\x20if\x20you\x20run\x20<code>go\x20install</code>\x20from\x20the\x0apackage\x20directory:\x0a</p>\x0a\x0a<pre>\x0a$\x20<b>cd\x20$GOPATH/src/github.com/user/hello</b>\x0a$\x20<b>go\x20install</b>\x0a</pre>\x0a\x0a<p>\x0aThis\x20command\x20builds\x20the\x20<code>hello</code>\x20command,\x20producing\x20an\x20executable\x0abinary.\x20It\x20then\x20installs\x20that\x20binary\x20to\x20the\x20workspace's\x20<code>bin</code>\x0adirectory\x20as\x20<code>hello</code>\x20(or,\x20under\x20Windows,\x20<code>hello.exe</code>).\x0aIn\x20our\x20example,\x20that\x20will\x20be\x20<code>$GOPATH/bin/hello</code>,\x20which\x20is\x0a<code>$HOME/go/bin/hello</code>.\x0a</p>\x0a\x0a<p>\x0aThe\x20<code>go</code>\x20tool\x20will\x20only\x20print\x20output\x20when\x20an\x20error\x20occurs,\x20so\x20if\x0athese\x20commands\x20produce\x20no\x20output\x20they\x20have\x20executed\x20successfully.\x0a</p>\x0a\x0a<p>\x0aYou\x20can\x20now\x20run\x20the\x20program\x20by\x20typing\x20its\x20full\x20path\x20at\x20the\x20command\x20line:\x0a</p>\x0a\x0a<pre>\x0a$\x20<b>$GOPATH/bin/hello</b>\x0aHello,\x20world.\x0a</pre>\x0a\x0a<p>\x0aOr,\x20as\x20you\x20have\x20added\x20<code>$GOPATH/bin</code>\x20to\x20your\x20<code>PATH</code>,\x0ajust\x20type\x20the\x20binary\x20name:\x0a</p>\x0a\x0a<pre>\x0a$\x20<b>hello</b>\x0aHello,\x20world.\x0a</pre>\x0a\x0a<p>\x0aIf\x20you're\x20using\x20a\x20source\x20control\x20system,\x20now\x20would\x20be\x20a\x20good\x20time\x20to\x20initialize\x0aa\x20repository,\x20add\x20the\x20files,\x20and\x20commit\x20your\x20first\x20change.\x20Again,\x20this\x20step\x20is\x0aoptional:\x20you\x20do\x20not\x20need\x20to\x20use\x20source\x20control\x20to\x20write\x20Go\x20code.\x0a</p>\x0a\x0a<pre>\x0a$\x20<b>cd\x20$GOPATH/src/github.com/user/hello</b>\x0a$\x20<b>git\x20init</b>\x0aInitialized\x20empty\x20Git\x20repository\x20in\x20/home/user/go/src/github.com/user/hello/.git/\x0a$\x20<b>git\x20add\x20hello.go</b>\x0a$\x20<b>git\x20commit\x20-m\x20\"initial\x20commit\"</b>\x0a[master\x20(root-commit)\x200b4507d]\x20initial\x20commit\x0a\x201\x20file\x20changed,\x207\x20insertion(+)\x0a\x20create\x20mode\x20100644\x20hello.go\x0a</pre>\x0a\x0a<p>\x0aPushing\x20the\x20code\x20to\x20a\x20remote\x20repository\x20is\x20left\x20as\x20an\x20exercise\x20for\x20the\x20reader.\x0a</p>\x0a\x0a\x0a<h3\x20id=\"Library\">Your\x20first\x20library</h3>\x0a\x0a<p>\x0aLet's\x20write\x20a\x20library\x20and\x20use\x20it\x20from\x20the\x20<code>hello</code>\x20program.\x0a</p>\x0a\x0a<p>\x0aAgain,\x20the\x20first\x20step\x20is\x20to\x20choose\x20a\x20package\x20path\x20(we'll\x20use\x0a<code>github.com/user/stringutil</code>)\x20and\x20create\x20the\x20package\x20directory:\x0a</p>\x0a\x0a<pre>\x0a$\x20<b>mkdir\x20$GOPATH/src/github.com/user/stringutil</b>\x0a</pre>\x0a\x0a<p>\x0aNext,\x20create\x20a\x20file\x20named\x20<code>reverse.go</code>\x20in\x20that\x20directory\x20with\x20the\x0afollowing\x20contents.\x0a</p>\x0a\x0a<pre>\x0a//\x20Package\x20stringutil\x20contains\x20utility\x20functions\x20for\x20working\x20with\x20strings.\x0apackage\x20stringutil\x0a\x0a//\x20Reverse\x20returns\x20its\x20argument\x20string\x20reversed\x20rune-wise\x20left\x20to\x20right.\x0afunc\x20Reverse(s\x20string)\x20string\x20{\x0a\x09r\x20:=\x20[]rune(s)\x0a\x09for\x20i,\x20j\x20:=\x200,\x20len(r)-1;\x20i\x20&lt;\x20len(r)/2;\x20i,\x20j\x20=\x20i+1,\x20j-1\x20{\x0a\x09\x09r[i],\x20r[j]\x20=\x20r[j],\x20r[i]\x0a\x09}\x0a\x09return\x20string(r)\x0a}\x0a</pre>\x0a\x0a<p>\x0aNow,\x20test\x20that\x20the\x20package\x20compiles\x20with\x20<code>go\x20build</code>:\x0a</p>\x0a\x0a<pre>\x0a$\x20<b>go\x20build\x20github.com/user/stringutil</b>\x0a</pre>\x0a\x0a<p>\x0aOr,\x20if\x20you\x20are\x20working\x20in\x20the\x20package's\x20source\x20directory,\x20just:\x0a</p>\x0a\x0a<pre>\x0a$\x20<b>go\x20build</b>\x0a</pre>\x0a\x0a<p>\x0aThis\x20won't\x20produce\x20an\x20output\x20file.\x0aInstead\x20it\x20saves\x20the\x20compiled\x20package\x20in\x20the\x20local\x20build\x20cache.\x0a</p>\x0a\x0a<p>\x0aAfter\x20confirming\x20that\x20the\x20<code>stringutil</code>\x20package\x20builds,\x0amodify\x20your\x20original\x20<code>hello.go</code>\x20(which\x20is\x20in\x0a<code>$GOPATH/src/github.com/user/hello</code>)\x20to\x20use\x20it:\x0a</p>\x0a\x0a<pre>\x0apackage\x20main\x0a\x0aimport\x20(\x0a\x09\"fmt\"\x0a\x0a\x09<b>\"github.com/user/stringutil\"</b>\x0a)\x0a\x0afunc\x20main()\x20{\x0a\x09fmt.Println(stringutil.Reverse(\"!oG\x20,olleH\"))\x0a}\x0a</pre>\x0a\x0a<p>\x0aInstall\x20the\x20<code>hello</code>\x20program:\x0a</p>\x0a\x0a<pre>\x0a$\x20<b>go\x20install\x20github.com/user/hello</b>\x0a</pre>\x0a\x0a<p>\x0aRunning\x20the\x20new\x20version\x20of\x20the\x20program,\x20you\x20should\x20see\x20a\x20new,\x20reversed\x20message:\x0a</p>\x0a\x0a<pre>\x0a$\x20<b>hello</b>\x0aHello,\x20Go!\x0a</pre>\x0a\x0a<p>\x0aAfter\x20the\x20steps\x20above,\x20your\x20workspace\x20should\x20look\x20like\x20this:\x0a</p>\x0a\x0a<pre>\x0abin/\x0a\x20\x20\x20\x20hello\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20command\x20executable\x0asrc/\x0a\x20\x20\x20\x20github.com/user/\x0a\x20\x20\x20\x20\x20\x20\x20\x20hello/\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20hello.go\x20\x20\x20\x20\x20\x20#\x20command\x20source\x0a\x20\x20\x20\x20\x20\x20\x20\x20stringutil/\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20reverse.go\x20\x20\x20\x20#\x20package\x20source\x0a</pre>\x0a\x0a<h3\x20id=\"PackageNames\">Package\x20names</h3>\x0a\x0a<p>\x0aThe\x20first\x20statement\x20in\x20a\x20Go\x20source\x20file\x20must\x20be\x0a</p>\x0a\x0a<pre>\x0apackage\x20<i>name</i>\x0a</pre>\x0a\x0a<p>\x0awhere\x20<code><i>name</i></code>\x20is\x20the\x20package's\x20default\x20name\x20for\x20imports.\x0a(All\x20files\x20in\x20a\x20package\x20must\x20use\x20the\x20same\x20<code><i>name</i></code>.)\x0a</p>\x0a\x0a<p>\x0aGo's\x20convention\x20is\x20that\x20the\x20package\x20name\x20is\x20the\x20last\x20element\x20of\x20the\x0aimport\x20path:\x20the\x20package\x20imported\x20as\x20\"<code>crypto/rot13</code>\"\x0ashould\x20be\x20named\x20<code>rot13</code>.\x0a</p>\x0a\x0a<p>\x0aExecutable\x20commands\x20must\x20always\x20use\x20<code>package\x20main</code>.\x0a</p>\x0a\x0a<p>\x0aThere\x20is\x20no\x20requirement\x20that\x20package\x20names\x20be\x20unique\x0aacross\x20all\x20packages\x20linked\x20into\x20a\x20single\x20binary,\x0aonly\x20that\x20the\x20import\x20paths\x20(their\x20full\x20file\x20names)\x20be\x20unique.\x0a</p>\x0a\x0a<p>\x0aSee\x20<a\x20href=\"/doc/effective_go.html#names\">Effective\x20Go</a>\x20to\x20learn\x20more\x20about\x0aGo's\x20naming\x20conventions.\x0a</p>\x0a\x0a\x0a<h2\x20id=\"Testing\">Testing</h2>\x0a\x0a<p>\x0aGo\x20has\x20a\x20lightweight\x20test\x20framework\x20composed\x20of\x20the\x20<code>go\x20test</code>\x0acommand\x20and\x20the\x20<code>testing</code>\x20package.\x0a</p>\x0a\x0a<p>\x0aYou\x20write\x20a\x20test\x20by\x20creating\x20a\x20file\x20with\x20a\x20name\x20ending\x20in\x20<code>_test.go</code>\x0athat\x20contains\x20functions\x20named\x20<code>TestXXX</code>\x20with\x20signature\x0a<code>func\x20(t\x20*testing.T)</code>.\x0aThe\x20test\x20framework\x20runs\x20each\x20such\x20function;\x0aif\x20the\x20function\x20calls\x20a\x20failure\x20function\x20such\x20as\x20<code>t.Error</code>\x20or\x0a<code>t.Fail</code>,\x20the\x20test\x20is\x20considered\x20to\x20have\x20failed.\x0a</p>\x0a\x0a<p>\x0aAdd\x20a\x20test\x20to\x20the\x20<code>stringutil</code>\x20package\x20by\x20creating\x20the\x20file\x0a<code>$GOPATH/src/github.com/user/stringutil/reverse_test.go</code>\x20containing\x0athe\x20following\x20Go\x20code.\x0a</p>\x0a\x0a<pre>\x0apackage\x20stringutil\x0a\x0aimport\x20\"testing\"\x0a\x0afunc\x20TestReverse(t\x20*testing.T)\x20{\x0a\x09cases\x20:=\x20[]struct\x20{\x0a\x09\x09in,\x20want\x20string\x0a\x09}{\x0a\x09\x09{\"Hello,\x20world\",\x20\"dlrow\x20,olleH\"},\x0a\x09\x09{\"Hello,\x20\xe4\xb8\x96\xe7\x95\x8c\",\x20\"\xe7\x95\x8c\xe4\xb8\x96\x20,olleH\"},\x0a\x09\x09{\"\",\x20\"\"},\x0a\x09}\x0a\x09for\x20_,\x20c\x20:=\x20range\x20cases\x20{\x0a\x09\x09got\x20:=\x20Reverse(c.in)\x0a\x09\x09if\x20got\x20!=\x20c.want\x20{\x0a\x09\x09\x09t.Errorf(\"Reverse(%q)\x20==\x20%q,\x20want\x20%q\",\x20c.in,\x20got,\x20c.want)\x0a\x09\x09}\x0a\x09}\x0a}\x0a</pre>\x0a\x0a<p>\x0aThen\x20run\x20the\x20test\x20with\x20<code>go\x20test</code>:\x0a</p>\x0a\x0a<pre>\x0a$\x20<b>go\x20test\x20github.com/user/stringutil</b>\x0aok\x20\x20\x09github.com/user/stringutil\x200.165s\x0a</pre>\x0a\x0a<p>\x0aAs\x20always,\x20if\x20you\x20are\x20running\x20the\x20<code>go</code>\x20tool\x20from\x20the\x20package\x0adirectory,\x20you\x20can\x20omit\x20the\x20package\x20path:\x0a</p>\x0a\x0a<pre>\x0a$\x20<b>go\x20test</b>\x0aok\x20\x20\x09github.com/user/stringutil\x200.165s\x0a</pre>\x0a\x0a<p>\x0aRun\x20<code><a\x20href=\"/cmd/go/#hdr-Test_packages\">go\x20help\x20test</a></code>\x20and\x20see\x20the\x0a<a\x20href=\"/pkg/testing/\">testing\x20package\x20documentation</a>\x20for\x20more\x20detail.\x0a</p>\x0a\x0a\x0a<h2\x20id=\"remote\">Remote\x20packages</h2>\x0a\x0a<p>\x0aAn\x20import\x20path\x20can\x20describe\x20how\x20to\x20obtain\x20the\x20package\x20source\x20code\x20using\x20a\x0arevision\x20control\x20system\x20such\x20as\x20Git\x20or\x20Mercurial.\x20The\x20<code>go</code>\x20tool\x20uses\x0athis\x20property\x20to\x20automatically\x20fetch\x20packages\x20from\x20remote\x20repositories.\x0aFor\x20instance,\x20the\x20examples\x20described\x20in\x20this\x20document\x20are\x20also\x20kept\x20in\x20a\x0aGit\x20repository\x20hosted\x20at\x20GitHub\x0a<code><a\x20href=\"https://github.com/golang/example\">github.com/golang/example</a></code>.\x0aIf\x20you\x20include\x20the\x20repository\x20URL\x20in\x20the\x20package's\x20import\x20path,\x0a<code>go\x20get</code>\x20will\x20fetch,\x20build,\x20and\x20install\x20it\x20automatically:\x0a</p>\x0a\x0a<pre>\x0a$\x20<b>go\x20get\x20github.com/golang/example/hello</b>\x0a$\x20<b>$GOPATH/bin/hello</b>\x0aHello,\x20Go\x20examples!\x0a</pre>\x0a\x0a<p>\x0aIf\x20the\x20specified\x20package\x20is\x20not\x20present\x20in\x20a\x20workspace,\x20<code>go\x20get</code>\x0awill\x20place\x20it\x20inside\x20the\x20first\x20workspace\x20specified\x20by\x20<code>GOPATH</code>.\x0a(If\x20the\x20package\x20does\x20already\x20exist,\x20<code>go\x20get</code>\x20skips\x20the\x20remote\x0afetch\x20and\x20behaves\x20the\x20same\x20as\x20<code>go\x20install</code>.)\x0a</p>\x0a\x0a<p>\x0aAfter\x20issuing\x20the\x20above\x20<code>go\x20get</code>\x20command,\x20the\x20workspace\x20directory\x0atree\x20should\x20now\x20look\x20like\x20this:\x0a</p>\x0a\x0a<pre>\x0abin/\x0a\x20\x20\x20\x20hello\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20command\x20executable\x0asrc/\x0a\x20\x20\x20\x20github.com/golang/example/\x0a\x09.git/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Git\x20repository\x20metadata\x0a\x20\x20\x20\x20\x20\x20\x20\x20hello/\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20hello.go\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20command\x20source\x0a\x20\x20\x20\x20\x20\x20\x20\x20stringutil/\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20reverse.go\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20package\x20source\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20reverse_test.go\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20test\x20source\x0a\x20\x20\x20\x20github.com/user/\x0a\x20\x20\x20\x20\x20\x20\x20\x20hello/\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20hello.go\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20command\x20source\x0a\x20\x20\x20\x20\x20\x20\x20\x20stringutil/\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20reverse.go\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20package\x20source\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20reverse_test.go\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20test\x20source\x0a</pre>\x0a\x0a<p>\x0aThe\x20<code>hello</code>\x20command\x20hosted\x20at\x20GitHub\x20depends\x20on\x20the\x0a<code>stringutil</code>\x20package\x20within\x20the\x20same\x20repository.\x20The\x20imports\x20in\x0a<code>hello.go</code>\x20file\x20use\x20the\x20same\x20import\x20path\x20convention,\x20so\x20the\x0a<code>go\x20get</code>\x20command\x20is\x20able\x20to\x20locate\x20and\x20install\x20the\x20dependent\x0apackage,\x20too.\x0a</p>\x0a\x0a<pre>\x0aimport\x20\"github.com/golang/example/stringutil\"\x0a</pre>\x0a\x0a<p>\x0aThis\x20convention\x20is\x20the\x20easiest\x20way\x20to\x20make\x20your\x20Go\x20packages\x20available\x20for\x0aothers\x20to\x20use.\x0aThe\x20<a\x20href=\"//golang.org/wiki/Projects\">Go\x20Wiki</a>\x0aand\x20<a\x20href=\"//godoc.org/\">godoc.org</a>\x0aprovide\x20lists\x20of\x20external\x20Go\x20projects.\x0a</p>\x0a\x0a<p>\x0aFor\x20more\x20information\x20on\x20using\x20remote\x20repositories\x20with\x20the\x20<code>go</code>\x20tool,\x20see\x0a<code><a\x20href=\"/cmd/go/#hdr-Remote_import_paths\">go\x20help\x20importpath</a></code>.\x0a</p>\x0a\x0a\x0a<h2\x20id=\"next\">What's\x20next</h2>\x0a\x0a<p>\x0aSubscribe\x20to\x20the\x0a<a\x20href=\"//groups.google.com/group/golang-announce\">golang-announce</a>\x0amailing\x20list\x20to\x20be\x20notified\x20when\x20a\x20new\x20stable\x20version\x20of\x20Go\x20is\x20released.\x0a</p>\x0a\x0a<p>\x0aSee\x20<a\x20href=\"/doc/effective_go.html\">Effective\x20Go</a>\x20for\x20tips\x20on\x20writing\x0aclear,\x20idiomatic\x20Go\x20code.\x0a</p>\x0a\x0a<p>\x0aTake\x20<a\x20href=\"//tour.golang.org/\">A\x20Tour\x20of\x20Go</a>\x20to\x20learn\x20the\x20language\x0aproper.\x0a</p>\x0a\x0a<p>\x0aVisit\x20the\x20<a\x20href=\"/doc/#articles\">documentation\x20page</a>\x20for\x20a\x20set\x20of\x20in-depth\x0aarticles\x20about\x20the\x20Go\x20language\x20and\x20its\x20libraries\x20and\x20tools.\x0a</p>\x0a\x0a\x0a<h2\x20id=\"help\">Getting\x20help</h2>\x0a\x0a<p>\x0aFor\x20real-time\x20help,\x20ask\x20the\x20helpful\x20gophers\x20in\x20<code>#go-nuts</code>\x20on\x20the\x0a<a\x20href=\"https://freenode.net/\">Freenode</a>\x20IRC\x20server.\x0a</p>\x0a\x0a<p>\x0aThe\x20official\x20mailing\x20list\x20for\x20discussion\x20of\x20the\x20Go\x20language\x20is\x0a<a\x20href=\"//groups.google.com/group/golang-nuts\">Go\x20Nuts</a>.\x0a</p>\x0a\x0a<p>\x0aReport\x20bugs\x20using\x20the\x0a<a\x20href=\"//golang.org/issue\">Go\x20issue\x20tracker</a>.\x0a</p>\x0a",
 
-	"doc/install.html": "<!--{\x0a\x20\x20\x20\x20\"Title\":\x20\"Download\x20and\x20install\",\x0a\x20\x20\x20\x20\"Path\":\x20\x20\"/doc/install\"\x0a}-->\x0a<p>\x0a\x20\x20Download\x20and\x20install\x20Go\x20quickly\x20with\x20the\x20steps\x20described\x20here.\x0a</p>\x0a<p>For\x20other\x20content\x20on\x20installing,\x20you\x20might\x20be\x20interested\x20in:</p>\x0a<ul>\x0a\x20\x20<li>\x0a\x20\x20\x20\x20<a\x20href=\"/doc/manage-install.html\">Managing\x20Go\x20installations</a>\x20--\x20How\x20to\x0a\x20\x20\x20\x20install\x20multiple\x20versions\x20and\x20uninstall.\x0a\x20\x20</li>\x0a\x20\x20<li>\x0a\x20\x20\x20\x20<a\x20href=\"/doc/install-source.html\">Installing\x20Go\x20from\x20source</a>\x20--\x20How\x20to\x0a\x20\x20\x20\x20check\x20out\x20the\x20sources,\x20build\x20them\x20on\x20your\x20own\x20machine,\x20and\x20run\x20them.\x0a\x20\x20</li>\x0a</ul>\x0a<h2\x20id=\"download\">1.\x20Go\x20download.</h2>\x0a<p>\x0a\x20\x20Click\x20the\x20button\x20below\x20to\x20download\x20the\x20Go\x20installer.\x0a</p>\x0a<p>\x0a\x20\x20<a\x20href=\"/dl/\"\x20id=\"start\"\x20class=\"download\x20js-download\">\x0a\x20\x20\x20\x20<span\x20id=\"download-button\"\x20class=\"big\x20js-downloadButton\">Download\x20Go</span>\x0a\x20\x20\x20\x20<span\x20id=\"download-description\"\x20class=\"desc\x20js-downloadDescription\"></span>\x0a\x20\x20</a>\x0a</p>\x0a<p>\x0a\x20\x20Don't\x20see\x20your\x20operating\x20system\x20here?\x20Try\x20one\x20of\x20the\x0a\x20\x20<a\x20href=\"https://golang.org/dl/\">other\x20downloads</a>.\x0a</p>\x0a<aside\x20class=\"Note\">\x0a\x20\x20<strong>Note:</strong>\x20By\x20default,\x20the\x20<code>go</code>\x20command\x20downloads\x20and\x0a\x20\x20authenticates\x20modules\x20using\x20the\x20Go\x20module\x20mirror\x20and\x20Go\x20checksum\x20database\x0a\x20\x20run\x20by\x20Google.\x20<a\x20href=\"https://golang.org/dl\">Learn\x20more.</a>\x0a</aside>\x0a<h2\x20id=\"install\">2.\x20Go\x20install.</h2>\x0a<p>\x0a\x20\x20Select\x20the\x20tab\x20for\x20your\x20computer's\x20operating\x20system\x20below,\x20then\x20follow\x20its\x0a\x20\x20installation\x20instructions.\x0a</p>\x0a<div\x20id=\"os-install-tabs\"\x20class=\"TabSection\x20js-tabSection\">\x0a\x20\x20<div\x20id=\"os-install-tablist\"\x20class=\"TabSection-tabList\"\x20role=\"tablist\">\x0a\x20\x20\x20\x20<button\x0a\x20\x20\x20\x20\x20\x20role=\"tab\"\x0a\x20\x20\x20\x20\x20\x20aria-selected=\"true\"\x0a\x20\x20\x20\x20\x20\x20aria-controls=\"linux-tab\"\x0a\x20\x20\x20\x20\x20\x20id=\"linux\"\x0a\x20\x20\x20\x20\x20\x20tabindex=\"0\"\x0a\x20\x20\x20\x20\x20\x20class=\"TabSection-tab\x20active\"\x0a\x20\x20\x20\x20>\x0a\x20\x20\x20\x20\x20\x20Linux\x0a\x20\x20\x20\x20</button>\x0a\x20\x20\x20\x20<button\x0a\x20\x20\x20\x20\x20\x20role=\"tab\"\x0a\x20\x20\x20\x20\x20\x20aria-selected=\"false\"\x0a\x20\x20\x20\x20\x20\x20aria-controls=\"mac-tab\"\x0a\x20\x20\x20\x20\x20\x20id=\"mac\"\x0a\x20\x20\x20\x20\x20\x20tabindex=\"-1\"\x0a\x20\x20\x20\x20\x20\x20class=\"TabSection-tab\"\x0a\x20\x20\x20\x20>\x0a\x20\x20\x20\x20\x20\x20Mac\x0a\x20\x20\x20\x20</button>\x0a\x20\x20\x20\x20<button\x0a\x20\x20\x20\x20\x20\x20role=\"tab\"\x0a\x20\x20\x20\x20\x20\x20aria-selected=\"false\"\x0a\x20\x20\x20\x20\x20\x20aria-controls=\"windows-tab\"\x0a\x20\x20\x20\x20\x20\x20id=\"windows\"\x0a\x20\x20\x20\x20\x20\x20tabindex=\"-1\"\x0a\x20\x20\x20\x20\x20\x20class=\"TabSection-tab\"\x0a\x20\x20\x20\x20>\x0a\x20\x20\x20\x20\x20\x20Windows\x0a\x20\x20\x20\x20</button>\x0a\x20\x20</div>\x0a\x20\x20<div\x0a\x20\x20\x20\x20role=\"tabpanel\"\x0a\x20\x20\x20\x20id=\"linux-tab\"\x0a\x20\x20\x20\x20class=\"TabSection-tabPanel\"\x0a\x20\x20\x20\x20aria-labelledby=\"linux\"\x0a\x20\x20>\x0a\x20\x20\x20\x20<p>\x0a\x20\x20\x20\x20\x20\x20If\x20you\x20have\x20a\x20previous\x20version\x20of\x20Go\x20installed,\x20be\x20sure\x20to\x0a\x20\x20\x20\x20\x20\x20<a\x20href=\"manage-install\">remove\x20it</a>\x20before\x20installing\x20another.\x0a\x20\x20\x20\x20</p>\x0a\x20\x20\x20\x20<ol>\x0a\x20\x20\x20\x20\x20\x20<li>\x0a\x20\x20\x20\x20\x20\x20\x20\x20Download\x20the\x20archive\x20and\x20extract\x20it\x20into\x20/usr/local,\x20creating\x20a\x20Go\x20tree\x0a\x20\x20\x20\x20\x20\x20\x20\x20in\x20/usr/local/go.\x0a\x20\x20\x20\x20\x20\x20\x20\x20<p>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20For\x20example,\x20run\x20the\x20following\x20as\x20root\x20or\x20through\x20<code>sudo</code>:\x0a\x20\x20\x20\x20\x20\x20\x20\x20</p>\x0a\x20\x20\x20\x20\x20\x20\x20\x20<pre>\x0atar\x20-C\x20/usr/local\x20-xzf\x20go1.14.3.linux-amd64.tar.gz\x0a</pre\x0a\x20\x20\x20\x20\x20\x20\x20\x20>\x0a\x20\x20\x20\x20\x20\x20</li>\x0a\x20\x20\x20\x20\x20\x20<li>\x0a\x20\x20\x20\x20\x20\x20\x20\x20Add\x20/usr/local/go/bin\x20to\x20the\x20<code>PATH</code>\x20environment\x20variable.\x0a\x20\x20\x20\x20\x20\x20\x20\x20<p>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20You\x20can\x20do\x20this\x20by\x20adding\x20the\x20following\x20line\x20to\x20your\x20$HOME/.profile\x20or\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20/etc/profile\x20(for\x20a\x20system-wide\x20installation):\x0a\x20\x20\x20\x20\x20\x20\x20\x20</p>\x0a\x20\x20\x20\x20\x20\x20\x20\x20<pre>\x0aexport\x20PATH=$PATH:/usr/local/go/bin\x0a</pre\x0a\x20\x20\x20\x20\x20\x20\x20\x20>\x0a\x20\x20\x20\x20\x20\x20\x20\x20<p>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<strong>Note:</strong>\x20Changes\x20made\x20to\x20a\x20profile\x20file\x20may\x20not\x20apply\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20until\x20the\x20next\x20time\x20you\x20log\x20into\x20your\x20computer.\x20To\x20apply\x20the\x20changes\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20immediately,\x20just\x20run\x20the\x20shell\x20commands\x20directly\x20or\x20execute\x20them\x20from\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20the\x20profile\x20using\x20a\x20command\x20such\x20as\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<code>source\x20$HOME/.profile</code>.\x0a\x20\x20\x20\x20\x20\x20\x20\x20</p>\x0a\x20\x20\x20\x20\x20\x20</li>\x0a\x20\x20\x20\x20\x20\x20<li>\x0a\x20\x20\x20\x20\x20\x20\x20\x20Verify\x20that\x20you've\x20installed\x20Go\x20by\x20opening\x20a\x20command\x20prompt\x20and\x20typing\x0a\x20\x20\x20\x20\x20\x20\x20\x20the\x20following\x20command:\x0a\x20\x20\x20\x20\x20\x20\x20\x20<pre>\x0a$\x20go\x20version\x0a</pre\x0a\x20\x20\x20\x20\x20\x20\x20\x20>\x0a\x20\x20\x20\x20\x20\x20</li>\x0a\x20\x20\x20\x20\x20\x20<li>Confirm\x20that\x20the\x20command\x20prints\x20the\x20installed\x20version\x20of\x20Go.</li>\x0a\x20\x20\x20\x20</ol>\x0a\x20\x20</div>\x0a\x20\x20<div\x0a\x20\x20\x20\x20role=\"tabpanel\"\x0a\x20\x20\x20\x20id=\"mac-tab\"\x0a\x20\x20\x20\x20class=\"TabSection-tabPanel\"\x0a\x20\x20\x20\x20aria-labelledby=\"mac\"\x0a\x20\x20\x20\x20hidden\x0a\x20\x20>\x0a\x20\x20\x20\x20<ol>\x0a\x20\x20\x20\x20\x20\x20<li>\x0a\x20\x20\x20\x20\x20\x20\x20\x20Open\x20the\x20package\x20file\x20you\x20downloaded\x20and\x20follow\x20the\x20prompts\x20to\x20install\x0a\x20\x20\x20\x20\x20\x20\x20\x20Go.\x0a\x20\x20\x20\x20\x20\x20\x20\x20<p>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20The\x20package\x20installs\x20the\x20Go\x20distribution\x20to\x20/usr/local/go.\x20The\x20package\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20should\x20put\x20the\x20/usr/local/go/bin\x20directory\x20in\x20your\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<code>PATH</code>\x20environment\x20variable.\x20You\x20may\x20need\x20to\x20restart\x20any\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20open\x20Terminal\x20sessions\x20for\x20the\x20change\x20to\x20take\x20effect.\x0a\x20\x20\x20\x20\x20\x20\x20\x20</p>\x0a\x20\x20\x20\x20\x20\x20</li>\x0a\x20\x20\x20\x20\x20\x20<li>\x0a\x20\x20\x20\x20\x20\x20\x20\x20Verify\x20that\x20you've\x20installed\x20Go\x20by\x20opening\x20a\x20command\x20prompt\x20and\x20typing\x0a\x20\x20\x20\x20\x20\x20\x20\x20the\x20following\x20command:\x0a\x20\x20\x20\x20\x20\x20\x20\x20<pre>\x0a$\x20go\x20version\x0a</pre\x0a\x20\x20\x20\x20\x20\x20\x20\x20>\x0a\x20\x20\x20\x20\x20\x20</li>\x0a\x20\x20\x20\x20\x20\x20<li>Confirm\x20that\x20the\x20command\x20prints\x20the\x20installed\x20version\x20of\x20Go.</li>\x0a\x20\x20\x20\x20</ol>\x0a\x20\x20</div>\x0a\x20\x20<div\x0a\x20\x20\x20\x20role=\"tabpanel\"\x0a\x20\x20\x20\x20id=\"windows-tab\"\x0a\x20\x20\x20\x20class=\"TabSection-tabPanel\"\x0a\x20\x20\x20\x20aria-labelledby=\"windows\"\x0a\x20\x20\x20\x20hidden\x0a\x20\x20>\x0a\x20\x20\x20\x20<ol>\x0a\x20\x20\x20\x20\x20\x20<li>\x0a\x20\x20\x20\x20\x20\x20\x20\x20Open\x20the\x20MSI\x20file\x20you\x20downloaded\x20and\x20follow\x20the\x20prompts\x20to\x20install\x20Go.\x0a\x20\x20\x20\x20\x20\x20\x20\x20<p>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20By\x20default,\x20the\x20installer\x20will\x20install\x20Go\x20to\x20C:\\Go.\x20You\x20can\x20change\x20the\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20location\x20as\x20needed.\x20After\x20installing,\x20you\x20will\x20need\x20to\x20close\x20and\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20reopen\x20any\x20open\x20command\x20prompts\x20so\x20that\x20changes\x20to\x20the\x20environment\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20made\x20by\x20the\x20installer\x20are\x20reflected\x20at\x20the\x20command\x20prompt.\x0a\x20\x20\x20\x20\x20\x20\x20\x20</p>\x0a\x20\x20\x20\x20\x20\x20</li>\x0a\x20\x20\x20\x20\x20\x20<li>\x0a\x20\x20\x20\x20\x20\x20\x20\x20Verify\x20that\x20you've\x20installed\x20Go.\x0a\x20\x20\x20\x20\x20\x20\x20\x20<ol>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<li>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20In\x20<strong>Windows</strong>,\x20click\x20the\x20<strong>Start</strong>\x20menu.\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</li>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<li>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20In\x20the\x20menu's\x20search\x20box,\x20type\x20<code>cmd</code>,\x20then\x20press\x20the\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<strong>Enter</strong>\x20key.\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</li>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<li>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20In\x20the\x20Command\x20Prompt\x20window\x20that\x20appears,\x20type\x20the\x20following\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20command:\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<pre>\x0a$\x20go\x20version\x0a</pre\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</li>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<li>Confirm\x20that\x20the\x20command\x20prints\x20the\x20installed\x20version\x20of\x20Go.</li>\x0a\x20\x20\x20\x20\x20\x20\x20\x20</ol>\x0a\x20\x20\x20\x20\x20\x20</li>\x0a\x20\x20\x20\x20</ol>\x0a\x20\x20</div>\x0a</div>\x0a<h2\x20id=\"code\">3.\x20Go\x20code.</h2>\x0a<p>\x0a\x20\x20You're\x20set\x20up!\x20Visit\x20the\x0a\x20\x20<a\x20href=\"tutorial/getting-started.html\">Getting\x20Started\x20tutorial</a>\x20to\x20write\x0a\x20\x20some\x20simple\x20Go\x20code.\x20It\x20takes\x20about\x2010\x20minutes\x20to\x20complete.\x0a</p>\x0a\x0a<script\x20async\x20src=\"/doc/download.js\"></script>",
+	"doc/install.html": "<!--{\x0a\x20\x20\x20\x20\"Title\":\x20\"Download\x20and\x20install\",\x0a\x20\x20\x20\x20\"Path\":\x20\x20\"/doc/install\"\x0a}-->\x0a<p>\x0a\x20\x20Download\x20and\x20install\x20Go\x20quickly\x20with\x20the\x20steps\x20described\x20here.\x0a</p>\x0a<p>For\x20other\x20content\x20on\x20installing,\x20you\x20might\x20be\x20interested\x20in:</p>\x0a<ul>\x0a\x20\x20<li>\x0a\x20\x20\x20\x20<a\x20href=\"/doc/manage-install.html\">Managing\x20Go\x20installations</a>\x20--\x20How\x20to\x0a\x20\x20\x20\x20install\x20multiple\x20versions\x20and\x20uninstall.\x0a\x20\x20</li>\x0a\x20\x20<li>\x0a\x20\x20\x20\x20<a\x20href=\"/doc/install-source.html\">Installing\x20Go\x20from\x20source</a>\x20--\x20How\x20to\x0a\x20\x20\x20\x20check\x20out\x20the\x20sources,\x20build\x20them\x20on\x20your\x20own\x20machine,\x20and\x20run\x20them.\x0a\x20\x20</li>\x0a</ul>\x0a<h2\x20id=\"download\">1.\x20Go\x20download.</h2>\x0a<p>\x0a\x20\x20Click\x20the\x20button\x20below\x20to\x20download\x20the\x20Go\x20installer.\x0a</p>\x0a<p>\x0a\x20\x20<a\x20href=\"/dl/\"\x20id=\"start\"\x20class=\"download\x20js-download\">\x0a\x20\x20\x20\x20<span\x20id=\"download-button\"\x20class=\"big\x20js-downloadButton\">Download\x20Go</span>\x0a\x20\x20\x20\x20<span\x20id=\"download-description\"\x20class=\"desc\x20js-downloadDescription\"></span>\x0a\x20\x20</a>\x0a</p>\x0a<p>\x0a\x20\x20Don't\x20see\x20your\x20operating\x20system\x20here?\x20Try\x20one\x20of\x20the\x0a\x20\x20<a\x20href=\"https://golang.org/dl/\">other\x20downloads</a>.\x0a</p>\x0a<aside\x20class=\"Note\">\x0a\x20\x20<strong>Note:</strong>\x20By\x20default,\x20the\x20<code>go</code>\x20command\x20downloads\x20and\x0a\x20\x20authenticates\x20modules\x20using\x20the\x20Go\x20module\x20mirror\x20and\x20Go\x20checksum\x20database\x0a\x20\x20run\x20by\x20Google.\x20<a\x20href=\"https://golang.org/dl\">Learn\x20more.</a>\x0a</aside>\x0a<h2\x20id=\"install\">2.\x20Go\x20install.</h2>\x0a<p>\x0a\x20\x20Select\x20the\x20tab\x20for\x20your\x20computer's\x20operating\x20system\x20below,\x20then\x20follow\x20its\x0a\x20\x20installation\x20instructions.\x0a</p>\x0a<div\x20id=\"os-install-tabs\"\x20class=\"TabSection\x20js-tabSection\">\x0a\x20\x20<div\x20id=\"os-install-tablist\"\x20class=\"TabSection-tabList\"\x20role=\"tablist\">\x0a\x20\x20\x20\x20<button\x0a\x20\x20\x20\x20\x20\x20role=\"tab\"\x0a\x20\x20\x20\x20\x20\x20aria-selected=\"true\"\x0a\x20\x20\x20\x20\x20\x20aria-controls=\"linux-tab\"\x0a\x20\x20\x20\x20\x20\x20id=\"linux\"\x0a\x20\x20\x20\x20\x20\x20tabindex=\"0\"\x0a\x20\x20\x20\x20\x20\x20class=\"TabSection-tab\x20active\"\x0a\x20\x20\x20\x20>\x0a\x20\x20\x20\x20\x20\x20Linux\x0a\x20\x20\x20\x20</button>\x0a\x20\x20\x20\x20<button\x0a\x20\x20\x20\x20\x20\x20role=\"tab\"\x0a\x20\x20\x20\x20\x20\x20aria-selected=\"false\"\x0a\x20\x20\x20\x20\x20\x20aria-controls=\"mac-tab\"\x0a\x20\x20\x20\x20\x20\x20id=\"mac\"\x0a\x20\x20\x20\x20\x20\x20tabindex=\"-1\"\x0a\x20\x20\x20\x20\x20\x20class=\"TabSection-tab\"\x0a\x20\x20\x20\x20>\x0a\x20\x20\x20\x20\x20\x20Mac\x0a\x20\x20\x20\x20</button>\x0a\x20\x20\x20\x20<button\x0a\x20\x20\x20\x20\x20\x20role=\"tab\"\x0a\x20\x20\x20\x20\x20\x20aria-selected=\"false\"\x0a\x20\x20\x20\x20\x20\x20aria-controls=\"windows-tab\"\x0a\x20\x20\x20\x20\x20\x20id=\"windows\"\x0a\x20\x20\x20\x20\x20\x20tabindex=\"-1\"\x0a\x20\x20\x20\x20\x20\x20class=\"TabSection-tab\"\x0a\x20\x20\x20\x20>\x0a\x20\x20\x20\x20\x20\x20Windows\x0a\x20\x20\x20\x20</button>\x0a\x20\x20</div>\x0a\x20\x20<div\x0a\x20\x20\x20\x20role=\"tabpanel\"\x0a\x20\x20\x20\x20id=\"linux-tab\"\x0a\x20\x20\x20\x20class=\"TabSection-tabPanel\"\x0a\x20\x20\x20\x20aria-labelledby=\"linux\"\x0a\x20\x20>\x0a\x20\x20\x20\x20<p>\x0a\x20\x20\x20\x20\x20\x20If\x20you\x20have\x20a\x20previous\x20version\x20of\x20Go\x20installed,\x20be\x20sure\x20to\x0a\x20\x20\x20\x20\x20\x20<a\x20href=\"manage-install\">remove\x20it</a>\x20before\x20installing\x20another.\x0a\x20\x20\x20\x20</p>\x0a\x20\x20\x20\x20<ol>\x0a\x20\x20\x20\x20\x20\x20<li>\x0a\x20\x20\x20\x20\x20\x20\x20\x20Download\x20the\x20archive\x20and\x20extract\x20it\x20into\x20/usr/local,\x20creating\x20a\x20Go\x20tree\x0a\x20\x20\x20\x20\x20\x20\x20\x20in\x20/usr/local/go.\x0a\x20\x20\x20\x20\x20\x20\x20\x20<p>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20For\x20example,\x20run\x20the\x20following\x20as\x20root\x20or\x20through\x20<code>sudo</code>:\x0a\x20\x20\x20\x20\x20\x20\x20\x20</p>\x0a\x20\x20\x20\x20\x20\x20\x20\x20<pre>\x0atar\x20-C\x20/usr/local\x20-xzf\x20<span\x20id=\"linux-filename\">go1.14.3.linux-amd64.tar.gz</span>\x0a</pre\x0a\x20\x20\x20\x20\x20\x20\x20\x20>\x0a\x20\x20\x20\x20\x20\x20</li>\x0a\x20\x20\x20\x20\x20\x20<li>\x0a\x20\x20\x20\x20\x20\x20\x20\x20Add\x20/usr/local/go/bin\x20to\x20the\x20<code>PATH</code>\x20environment\x20variable.\x0a\x20\x20\x20\x20\x20\x20\x20\x20<p>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20You\x20can\x20do\x20this\x20by\x20adding\x20the\x20following\x20line\x20to\x20your\x20$HOME/.profile\x20or\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20/etc/profile\x20(for\x20a\x20system-wide\x20installation):\x0a\x20\x20\x20\x20\x20\x20\x20\x20</p>\x0a\x20\x20\x20\x20\x20\x20\x20\x20<pre>\x0aexport\x20PATH=$PATH:/usr/local/go/bin\x0a</pre\x0a\x20\x20\x20\x20\x20\x20\x20\x20>\x0a\x20\x20\x20\x20\x20\x20\x20\x20<p>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<strong>Note:</strong>\x20Changes\x20made\x20to\x20a\x20profile\x20file\x20may\x20not\x20apply\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20until\x20the\x20next\x20time\x20you\x20log\x20into\x20your\x20computer.\x20To\x20apply\x20the\x20changes\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20immediately,\x20just\x20run\x20the\x20shell\x20commands\x20directly\x20or\x20execute\x20them\x20from\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20the\x20profile\x20using\x20a\x20command\x20such\x20as\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<code>source\x20$HOME/.profile</code>.\x0a\x20\x20\x20\x20\x20\x20\x20\x20</p>\x0a\x20\x20\x20\x20\x20\x20</li>\x0a\x20\x20\x20\x20\x20\x20<li>\x0a\x20\x20\x20\x20\x20\x20\x20\x20Verify\x20that\x20you've\x20installed\x20Go\x20by\x20opening\x20a\x20command\x20prompt\x20and\x20typing\x0a\x20\x20\x20\x20\x20\x20\x20\x20the\x20following\x20command:\x0a\x20\x20\x20\x20\x20\x20\x20\x20<pre>\x0a$\x20go\x20version\x0a</pre\x0a\x20\x20\x20\x20\x20\x20\x20\x20>\x0a\x20\x20\x20\x20\x20\x20</li>\x0a\x20\x20\x20\x20\x20\x20<li>Confirm\x20that\x20the\x20command\x20prints\x20the\x20installed\x20version\x20of\x20Go.</li>\x0a\x20\x20\x20\x20</ol>\x0a\x20\x20</div>\x0a\x20\x20<div\x0a\x20\x20\x20\x20role=\"tabpanel\"\x0a\x20\x20\x20\x20id=\"mac-tab\"\x0a\x20\x20\x20\x20class=\"TabSection-tabPanel\"\x0a\x20\x20\x20\x20aria-labelledby=\"mac\"\x0a\x20\x20\x20\x20hidden\x0a\x20\x20>\x0a\x20\x20\x20\x20<ol>\x0a\x20\x20\x20\x20\x20\x20<li>\x0a\x20\x20\x20\x20\x20\x20\x20\x20Open\x20the\x20package\x20file\x20you\x20downloaded\x20and\x20follow\x20the\x20prompts\x20to\x20install\x0a\x20\x20\x20\x20\x20\x20\x20\x20Go.\x0a\x20\x20\x20\x20\x20\x20\x20\x20<p>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20The\x20package\x20installs\x20the\x20Go\x20distribution\x20to\x20/usr/local/go.\x20The\x20package\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20should\x20put\x20the\x20/usr/local/go/bin\x20directory\x20in\x20your\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<code>PATH</code>\x20environment\x20variable.\x20You\x20may\x20need\x20to\x20restart\x20any\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20open\x20Terminal\x20sessions\x20for\x20the\x20change\x20to\x20take\x20effect.\x0a\x20\x20\x20\x20\x20\x20\x20\x20</p>\x0a\x20\x20\x20\x20\x20\x20</li>\x0a\x20\x20\x20\x20\x20\x20<li>\x0a\x20\x20\x20\x20\x20\x20\x20\x20Verify\x20that\x20you've\x20installed\x20Go\x20by\x20opening\x20a\x20command\x20prompt\x20and\x20typing\x0a\x20\x20\x20\x20\x20\x20\x20\x20the\x20following\x20command:\x0a\x20\x20\x20\x20\x20\x20\x20\x20<pre>\x0a$\x20go\x20version\x0a</pre\x0a\x20\x20\x20\x20\x20\x20\x20\x20>\x0a\x20\x20\x20\x20\x20\x20</li>\x0a\x20\x20\x20\x20\x20\x20<li>Confirm\x20that\x20the\x20command\x20prints\x20the\x20installed\x20version\x20of\x20Go.</li>\x0a\x20\x20\x20\x20</ol>\x0a\x20\x20</div>\x0a\x20\x20<div\x0a\x20\x20\x20\x20role=\"tabpanel\"\x0a\x20\x20\x20\x20id=\"windows-tab\"\x0a\x20\x20\x20\x20class=\"TabSection-tabPanel\"\x0a\x20\x20\x20\x20aria-labelledby=\"windows\"\x0a\x20\x20\x20\x20hidden\x0a\x20\x20>\x0a\x20\x20\x20\x20<ol>\x0a\x20\x20\x20\x20\x20\x20<li>\x0a\x20\x20\x20\x20\x20\x20\x20\x20Open\x20the\x20MSI\x20file\x20you\x20downloaded\x20and\x20follow\x20the\x20prompts\x20to\x20install\x20Go.\x0a\x20\x20\x20\x20\x20\x20\x20\x20<p>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20By\x20default,\x20the\x20installer\x20will\x20install\x20Go\x20to\x20C:\\Go.\x20You\x20can\x20change\x20the\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20location\x20as\x20needed.\x20After\x20installing,\x20you\x20will\x20need\x20to\x20close\x20and\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20reopen\x20any\x20open\x20command\x20prompts\x20so\x20that\x20changes\x20to\x20the\x20environment\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20made\x20by\x20the\x20installer\x20are\x20reflected\x20at\x20the\x20command\x20prompt.\x0a\x20\x20\x20\x20\x20\x20\x20\x20</p>\x0a\x20\x20\x20\x20\x20\x20</li>\x0a\x20\x20\x20\x20\x20\x20<li>\x0a\x20\x20\x20\x20\x20\x20\x20\x20Verify\x20that\x20you've\x20installed\x20Go.\x0a\x20\x20\x20\x20\x20\x20\x20\x20<ol>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<li>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20In\x20<strong>Windows</strong>,\x20click\x20the\x20<strong>Start</strong>\x20menu.\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</li>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<li>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20In\x20the\x20menu's\x20search\x20box,\x20type\x20<code>cmd</code>,\x20then\x20press\x20the\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<strong>Enter</strong>\x20key.\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</li>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<li>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20In\x20the\x20Command\x20Prompt\x20window\x20that\x20appears,\x20type\x20the\x20following\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20command:\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<pre>\x0a$\x20go\x20version\x0a</pre\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</li>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<li>Confirm\x20that\x20the\x20command\x20prints\x20the\x20installed\x20version\x20of\x20Go.</li>\x0a\x20\x20\x20\x20\x20\x20\x20\x20</ol>\x0a\x20\x20\x20\x20\x20\x20</li>\x0a\x20\x20\x20\x20</ol>\x0a\x20\x20</div>\x0a</div>\x0a<h2\x20id=\"code\">3.\x20Go\x20code.</h2>\x0a<p>\x0a\x20\x20You're\x20set\x20up!\x20Visit\x20the\x0a\x20\x20<a\x20href=\"tutorial/getting-started.html\">Getting\x20Started\x20tutorial</a>\x20to\x20write\x0a\x20\x20some\x20simple\x20Go\x20code.\x20It\x20takes\x20about\x2010\x20minutes\x20to\x20complete.\x0a</p>\x0a\x0a<script\x20async\x20src=\"/doc/download.js\"></script>\x0a",
 
 	"doc/install-source.html": "<!--{\x0a\x09\"Title\":\x20\"Installing\x20Go\x20from\x20source\",\x0a\x09\"Path\":\x20\"/doc/install/source\"\x0a}-->\x0a\x0a<p>This\x20topic\x20describes\x20how\x20to\x20build\x20and\x20run\x20Go\x20from\x20source\x20code.\x20To\x20install\x20with\x20an\x20installer,\x20see\x20<a\x20href=\"/doc/install.html\">Download\x20and\x20install</a>.</p>\x0a\x0a<h2\x20id=\"introduction\">Introduction</h2>\x0a\x0a<p>\x0aGo\x20is\x20an\x20open\x20source\x20project,\x20distributed\x20under\x20a\x0a<a\x20href=\"/LICENSE\">BSD-style\x20license</a>.\x0aThis\x20document\x20explains\x20how\x20to\x20check\x20out\x20the\x20sources,\x0abuild\x20them\x20on\x20your\x20own\x20machine,\x20and\x20run\x20them.\x0a</p>\x0a\x0a<p>\x0aMost\x20users\x20don't\x20need\x20to\x20do\x20this,\x20and\x20will\x20instead\x20install\x0afrom\x20precompiled\x20binary\x20packages\x20as\x20described\x20in\x0a<a\x20href=\"/doc/install\">Download\x20and\x20install</a>,\x0aa\x20much\x20simpler\x20process.\x0aIf\x20you\x20want\x20to\x20help\x20develop\x20what\x20goes\x20into\x20those\x20precompiled\x0apackages,\x20though,\x20read\x20on.\x0a</p>\x0a\x0a<div\x20class=\"detail\">\x0a\x0a<p>\x0aThere\x20are\x20two\x20official\x20Go\x20compiler\x20toolchains.\x0aThis\x20document\x20focuses\x20on\x20the\x20<code>gc</code>\x20Go\x0acompiler\x20and\x20tools.\x0aFor\x20information\x20on\x20how\x20to\x20work\x20on\x20<code>gccgo</code>,\x20a\x20more\x20traditional\x0acompiler\x20using\x20the\x20GCC\x20back\x20end,\x20see\x0a<a\x20href=\"/doc/install/gccgo\">Setting\x20up\x20and\x20using\x20gccgo</a>.\x0a</p>\x0a\x0a<p>\x0aThe\x20Go\x20compilers\x20support\x20the\x20following\x20instruction\x20sets:\x0a\x0a<dl>\x0a<dt>\x0a\x20\x20<code>amd64</code>,\x20<code>386</code>\x0a</dt>\x0a<dd>\x0a\x20\x20The\x20<code>x86</code>\x20instruction\x20set,\x2064-\x20and\x2032-bit.\x0a</dd>\x0a<dt>\x0a\x20\x20<code>arm64</code>,\x20<code>arm</code>\x0a</dt>\x0a<dd>\x0a\x20\x20The\x20<code>ARM</code>\x20instruction\x20set,\x2064-bit\x20(<code>AArch64</code>)\x20and\x2032-bit.\x0a</dd>\x0a<dt>\x0a\x20\x20<code>mips64</code>,\x20<code>mips64le</code>,\x20<code>mips</code>,\x20\x20<code>mipsle</code>\x0a</dt>\x0a<dd>\x0a\x20\x20The\x20<code>MIPS</code>\x20instruction\x20set,\x20big-\x20and\x20little-endian,\x2064-\x20and\x2032-bit.\x0a</dd>\x0a<dt>\x0a\x20\x20<code>ppc64</code>,\x20<code>ppc64le</code>\x0a</dt>\x0a<dd>\x0a\x20\x20The\x2064-bit\x20PowerPC\x20instruction\x20set,\x20big-\x20and\x20little-endian.\x0a</dd>\x0a<dt>\x0a\x20\x20<code>riscv64</code>\x0a</dt>\x0a<dd>\x0a\x20\x20The\x2064-bit\x20RISC-V\x20instruction\x20set.\x0a</dd>\x0a<dt>\x0a\x20\x20<code>s390x</code>\x0a</dt>\x0a<dd>\x0a\x20\x20The\x20IBM\x20z/Architecture.\x0a</dd>\x0a<dt>\x0a\x20\x20<code>wasm</code>\x0a</dt>\x0a<dd>\x0a\x20\x20<a\x20href=\"https://webassembly.org\">WebAssembly</a>.\x0a</dd>\x0a</dl>\x0a</p>\x0a\x0a<p>\x0aThe\x20compilers\x20can\x20target\x20the\x20AIX,\x20Android,\x20DragonFly\x20BSD,\x20FreeBSD,\x0aIllumos,\x20Linux,\x20macOS/iOS\x20(Darwin),\x20NetBSD,\x20OpenBSD,\x20Plan\x209,\x20Solaris,\x0aand\x20Windows\x20operating\x20systems\x20(although\x20not\x20all\x20operating\x20systems\x0asupport\x20all\x20architectures).\x0a</p>\x0a\x0a<p>\x0aA\x20list\x20of\x20ports\x20which\x20are\x20considered\x20\"first\x20class\"\x20is\x20available\x20at\x20the\x0a<a\x20href=\"/wiki/PortingPolicy#first-class-ports\">first\x20class\x20ports</a>\x0awiki\x20page.\x0a</p>\x0a\x0a<p>\x0aThe\x20full\x20set\x20of\x20supported\x20combinations\x20is\x20listed\x20in\x20the\x0adiscussion\x20of\x20<a\x20href=\"#environment\">environment\x20variables</a>\x20below.\x0a</p>\x0a\x0a<p>\x0aSee\x20the\x20main\x20installation\x20page\x20for\x20the\x20<a\x20href=\"/doc/install#requirements\">overall\x20system\x20requirements</a>.\x0aThe\x20following\x20additional\x20constraints\x20apply\x20to\x20systems\x20that\x20can\x20be\x20built\x20only\x20from\x20source:\x0a</p>\x0a\x0a<ul>\x0a<li>For\x20Linux\x20on\x20PowerPC\x2064-bit,\x20the\x20minimum\x20supported\x20kernel\x20version\x20is\x202.6.37,\x20meaning\x20that\x0aGo\x20does\x20not\x20support\x20CentOS\x206\x20on\x20these\x20systems.\x0a</li>\x0a</ul>\x0a\x20\x0a</div>\x0a\x0a<h2\x20id=\"go14\">Install\x20Go\x20compiler\x20binaries\x20for\x20bootstrap</h2>\x0a\x0a<p>\x0aThe\x20Go\x20toolchain\x20is\x20written\x20in\x20Go.\x20To\x20build\x20it,\x20you\x20need\x20a\x20Go\x20compiler\x20installed.\x0aThe\x20scripts\x20that\x20do\x20the\x20initial\x20build\x20of\x20the\x20tools\x20look\x20for\x20a\x20\"go\"\x20command\x0ain\x20<code>$PATH</code>,\x20so\x20as\x20long\x20as\x20you\x20have\x20Go\x20installed\x20in\x20your\x0asystem\x20and\x20configured\x20in\x20your\x20<code>$PATH</code>,\x20you\x20are\x20ready\x20to\x20build\x20Go\x0afrom\x20source.\x20\x0aOr\x20if\x20you\x20prefer\x20you\x20can\x20set\x20<code>$GOROOT_BOOTSTRAP</code>\x20to\x20the\x0aroot\x20of\x20a\x20Go\x20installation\x20to\x20use\x20to\x20build\x20the\x20new\x20Go\x20toolchain;\x0a<code>$GOROOT_BOOTSTRAP/bin/go</code>\x20should\x20be\x20the\x20go\x20command\x20to\x20use.</p>\x0a\x0a<h3\x20id=\"bootstrapFromBinaryRelease\">Bootstrap\x20toolchain\x20from\x20binary\x20release</h3>\x0a\x0a<p>\x0aTo\x20use\x20a\x20binary\x20release\x20as\x20a\x20bootstrap\x20toolchain,\x20see\x0a<a\x20href=\"/dl/\">the\x20downloads\x20page</a>\x20or\x20use\x20any\x20other\x0apackaged\x20Go\x20distribution.\x0a</p>\x0a\x0a<h3\x20id=\"bootstrapFromSource\">Bootstrap\x20toolchain\x20from\x20source</h3>\x0a\x0a<p>\x0aTo\x20build\x20a\x20bootstrap\x20toolchain\x20from\x20source,\x20use\x0aeither\x20the\x20git\x20branch\x20<code>release-branch.go1.4</code>\x20or\x0a<a\x20href=\"https://dl.google.com/go/go1.4-bootstrap-20171003.tar.gz\">go1.4-bootstrap-20171003.tar.gz</a>,\x0awhich\x20contains\x20the\x20Go\x201.4\x20source\x20code\x20plus\x20accumulated\x20fixes\x0ato\x20keep\x20the\x20tools\x20running\x20on\x20newer\x20operating\x20systems.\x0a(Go\x201.4\x20was\x20the\x20last\x20distribution\x20in\x20which\x20the\x20toolchain\x20was\x20written\x20in\x20C.)\x0aAfter\x20unpacking\x20the\x20Go\x201.4\x20source,\x20<code>cd</code>\x20to\x0athe\x20<code>src</code>\x20subdirectory,\x20set\x20<code>CGO_ENABLED=0</code>\x20in\x0athe\x20environment,\x20and\x20run\x20<code>make.bash</code>\x20(or,\x0aon\x20Windows,\x20<code>make.bat</code>).\x0a</p>\x0a\x0a<p>\x0aOnce\x20the\x20Go\x201.4\x20source\x20has\x20been\x20unpacked\x20into\x20your\x20GOROOT_BOOTSTRAP\x20directory,\x0ayou\x20must\x20keep\x20this\x20git\x20clone\x20instance\x20checked\x20out\x20to\x20branch\x0a<code>release-branch.go1.4</code>.\x20\x20Specifically,\x20do\x20not\x20attempt\x20to\x20reuse\x0athis\x20git\x20clone\x20in\x20the\x20later\x20step\x20named\x20\"Fetch\x20the\x20repository.\"\x20\x20The\x20go1.4\x0abootstrap\x20toolchain\x20<b>must\x20be\x20able</b>\x20to\x20properly\x20traverse\x20the\x20go1.4\x20sources\x0athat\x20it\x20assumes\x20are\x20present\x20under\x20this\x20repository\x20root.\x0a</p>\x0a\x0a<h3\x20id=\"bootstrapFromCrosscompiledSource\">Bootstrap\x20toolchain\x20from\x20cross-compiled\x20source</h3>\x0a\x0a<p>\x0aTo\x20cross-compile\x20a\x20bootstrap\x20toolchain\x20from\x20source,\x20which\x20is\x0anecessary\x20on\x20systems\x20Go\x201.4\x20did\x20not\x20target\x20(for\x0aexample,\x20<code>linux/ppc64le</code>),\x20install\x20Go\x20on\x20a\x20different\x20system\x0aand\x20run\x20<a\x20href=\"/src/bootstrap.bash\">bootstrap.bash</a>.\x0a</p>\x0a\x0a<p>\x0aWhen\x20run\x20as\x20(for\x20example)\x0a</p>\x0a\x0a<pre>\x0a$\x20GOOS=linux\x20GOARCH=ppc64\x20./bootstrap.bash\x0a</pre>\x0a\x0a<p>\x0a<code>bootstrap.bash</code>\x20cross-compiles\x20a\x20toolchain\x20for\x20that\x20<code>GOOS/GOARCH</code>\x0acombination,\x20leaving\x20the\x20resulting\x20tree\x20in\x20<code>../../go-${GOOS}-${GOARCH}-bootstrap</code>.\x0aThat\x20tree\x20can\x20be\x20copied\x20to\x20a\x20machine\x20of\x20the\x20given\x20target\x20type\x0aand\x20used\x20as\x20<code>GOROOT_BOOTSTRAP</code>\x20to\x20bootstrap\x20a\x20local\x20build.\x0a</p>\x0a\x0a<h3\x20id=\"bootstrapFromGccgo\">Bootstrap\x20toolchain\x20using\x20gccgo</h3>\x0a\x0a<p>\x0aTo\x20use\x20gccgo\x20as\x20the\x20bootstrap\x20toolchain,\x20you\x20need\x20to\x20arrange\x0afor\x20<code>$GOROOT_BOOTSTRAP/bin/go</code>\x20to\x20be\x20the\x20go\x20tool\x20that\x20comes\x0aas\x20part\x20of\x20gccgo\x205.\x20For\x20example\x20on\x20Ubuntu\x20Vivid:\x0a</p>\x0a\x0a<pre>\x0a$\x20sudo\x20apt-get\x20install\x20gccgo-5\x0a$\x20sudo\x20update-alternatives\x20--set\x20go\x20/usr/bin/go-5\x0a$\x20GOROOT_BOOTSTRAP=/usr\x20./make.bash\x0a</pre>\x0a\x0a<h2\x20id=\"git\">Install\x20Git,\x20if\x20needed</h2>\x0a\x0a<p>\x0aTo\x20perform\x20the\x20next\x20step\x20you\x20must\x20have\x20Git\x20installed.\x20(Check\x20that\x20you\x0ahave\x20a\x20<code>git</code>\x20command\x20before\x20proceeding.)\x0a</p>\x0a\x0a<p>\x0aIf\x20you\x20do\x20not\x20have\x20a\x20working\x20Git\x20installation,\x0afollow\x20the\x20instructions\x20on\x20the\x0a<a\x20href=\"https://git-scm.com/downloads\">Git\x20downloads</a>\x20page.\x0a</p>\x0a\x0a<h2\x20id=\"ccompiler\">(Optional)\x20Install\x20a\x20C\x20compiler</h2>\x0a\x0a<p>\x0aTo\x20build\x20a\x20Go\x20installation\x0awith\x20<code><a\x20href=\"/cmd/cgo\">cgo</a></code>\x20support,\x20which\x20permits\x20Go\x0aprograms\x20to\x20import\x20C\x20libraries,\x20a\x20C\x20compiler\x20such\x20as\x20<code>gcc</code>\x0aor\x20<code>clang</code>\x20must\x20be\x20installed\x20first.\x20Do\x20this\x20using\x20whatever\x0ainstallation\x20method\x20is\x20standard\x20on\x20the\x20system.\x0a</p>\x0a\x0a<p>\x0aTo\x20build\x20without\x20<code>cgo</code>,\x20set\x20the\x20environment\x20variable\x0a<code>CGO_ENABLED=0</code>\x20before\x20running\x20<code>all.bash</code>\x20or\x0a<code>make.bash</code>.\x0a</p>\x0a\x0a<h2\x20id=\"fetch\">Fetch\x20the\x20repository</h2>\x0a\x0a<p>Change\x20to\x20the\x20directory\x20where\x20you\x20intend\x20to\x20install\x20Go,\x20and\x20make\x20sure\x0athe\x20<code>goroot</code>\x20directory\x20does\x20not\x20exist.\x20Then\x20clone\x20the\x20repository\x0aand\x20check\x20out\x20the\x20latest\x20release\x20tag\x20(<code\x20class=\"versionTag\">go1.12</code>,\x0afor\x20example):</p>\x0a\x0a<pre>\x0a$\x20git\x20clone\x20https://go.googlesource.com/go\x20goroot\x0a$\x20cd\x20goroot\x0a$\x20git\x20checkout\x20<span\x20class=\"versionTag\"><i>&lt;tag&gt;</i></span>\x0a</pre>\x0a\x0a<p\x20class=\"whereTag\">\x0aWhere\x20<code>&lt;tag&gt;</code>\x20is\x20the\x20version\x20string\x20of\x20the\x20release.\x0a</p>\x0a\x0a<p>Go\x20will\x20be\x20installed\x20in\x20the\x20directory\x20where\x20it\x20is\x20checked\x20out.\x20For\x20example,\x0aif\x20Go\x20is\x20checked\x20out\x20in\x20<code>$HOME/goroot</code>,\x20executables\x20will\x20be\x20installed\x0ain\x20<code>$HOME/goroot/bin</code>.\x20The\x20directory\x20may\x20have\x20any\x20name,\x20but\x20note\x0athat\x20if\x20Go\x20is\x20checked\x20out\x20in\x20<code>$HOME/go</code>,\x20it\x20will\x20conflict\x20with\x0athe\x20default\x20location\x20of\x20<code>$GOPATH</code>.\x0aSee\x20<a\x20href=\"#gopath\"><code>GOPATH</code></a>\x20below.</p>\x0a\x0a<p>\x0aReminder:\x20If\x20you\x20opted\x20to\x20also\x20compile\x20the\x20bootstrap\x20binaries\x20from\x20source\x20(in\x20an\x0aearlier\x20section),\x20you\x20still\x20need\x20to\x20<code>git\x20clone</code>\x20again\x20at\x20this\x20point\x0a(to\x20checkout\x20the\x20latest\x20<code>&lt;tag&gt;</code>),\x20because\x20you\x20must\x20keep\x20your\x0ago1.4\x20repository\x20distinct.\x0a</p>\x0a\x0a<h2\x20id=\"head\">(Optional)\x20Switch\x20to\x20the\x20master\x20branch</h2>\x0a\x0a<p>If\x20you\x20intend\x20to\x20modify\x20the\x20go\x20source\x20code,\x20and\x0a<a\x20href=\"/doc/contribute.html\">contribute\x20your\x20changes</a>\x0ato\x20the\x20project,\x20then\x20move\x20your\x20repository\x0aoff\x20the\x20release\x20branch,\x20and\x20onto\x20the\x20master\x20(development)\x20branch.\x0aOtherwise,\x20skip\x20this\x20step.</p>\x0a\x0a<pre>\x0a$\x20git\x20checkout\x20master\x0a</pre>\x0a\x0a<h2\x20id=\"install\">Install\x20Go</h2>\x0a\x0a<p>\x0aTo\x20build\x20the\x20Go\x20distribution,\x20run\x0a</p>\x0a\x0a<pre>\x0a$\x20cd\x20src\x0a$\x20./all.bash\x0a</pre>\x0a\x0a<p>\x0a(To\x20build\x20under\x20Windows\x20use\x20<code>all.bat</code>.)\x0a</p>\x0a\x0a<p>\x0aIf\x20all\x20goes\x20well,\x20it\x20will\x20finish\x20by\x20printing\x20output\x20like:\x0a</p>\x0a\x0a<pre>\x0aALL\x20TESTS\x20PASSED\x0a\x0a---\x0aInstalled\x20Go\x20for\x20linux/amd64\x20in\x20/home/you/go.\x0aInstalled\x20commands\x20in\x20/home/you/go/bin.\x0a***\x20You\x20need\x20to\x20add\x20/home/you/go/bin\x20to\x20your\x20$PATH.\x20***\x0a</pre>\x0a\x0a<p>\x0awhere\x20the\x20details\x20on\x20the\x20last\x20few\x20lines\x20reflect\x20the\x20operating\x20system,\x0aarchitecture,\x20and\x20root\x20directory\x20used\x20during\x20the\x20install.\x0a</p>\x0a\x0a<div\x20class=\"detail\">\x0a<p>\x0aFor\x20more\x20information\x20about\x20ways\x20to\x20control\x20the\x20build,\x20see\x20the\x20discussion\x20of\x0a<a\x20href=\"#environment\">environment\x20variables</a>\x20below.\x0a<code>all.bash</code>\x20(or\x20<code>all.bat</code>)\x20runs\x20important\x20tests\x20for\x20Go,\x0awhich\x20can\x20take\x20more\x20time\x20than\x20simply\x20building\x20Go.\x20If\x20you\x20do\x20not\x20want\x20to\x20run\x0athe\x20test\x20suite\x20use\x20<code>make.bash</code>\x20(or\x20<code>make.bat</code>)\x0ainstead.\x0a</p>\x0a</div>\x0a\x0a\x0a<h2\x20id=\"testing\">Testing\x20your\x20installation</h2>\x0a\x0a<p>\x0aCheck\x20that\x20Go\x20is\x20installed\x20correctly\x20by\x20building\x20a\x20simple\x20program.\x0a</p>\x0a\x0a<p>\x0aCreate\x20a\x20file\x20named\x20<code>hello.go</code>\x20and\x20put\x20the\x20following\x20program\x20in\x20it:\x0a</p>\x0a\x0a<pre>\x0apackage\x20main\x0a\x0aimport\x20\"fmt\"\x0a\x0afunc\x20main()\x20{\x0a\x09fmt.Printf(\"hello,\x20world\\n\")\x0a}\x0a</pre>\x0a\x0a<p>\x0aThen\x20run\x20it\x20with\x20the\x20<code>go</code>\x20tool:\x0a</p>\x0a\x0a<pre>\x0a$\x20go\x20run\x20hello.go\x0ahello,\x20world\x0a</pre>\x0a\x0a<p>\x0aIf\x20you\x20see\x20the\x20\"hello,\x20world\"\x20message\x20then\x20Go\x20is\x20installed\x20correctly.\x0a</p>\x0a\x0a<h2\x20id=\"gopath\">Set\x20up\x20your\x20work\x20environment</h2>\x0a\x0a<p>\x0aYou're\x20almost\x20done.\x0aYou\x20just\x20need\x20to\x20do\x20a\x20little\x20more\x20setup.\x0a</p>\x0a\x0a<p>\x0a<a\x20href=\"/doc/code.html\"\x20class=\"download\"\x20id=\"start\">\x0a<span\x20class=\"big\">How\x20to\x20Write\x20Go\x20Code</span>\x0a<span\x20class=\"desc\">Learn\x20how\x20to\x20set\x20up\x20and\x20use\x20the\x20Go\x20tools</span>\x0a</a>\x0a</p>\x0a\x0a<p>\x0aThe\x20<a\x20href=\"/doc/code.html\">How\x20to\x20Write\x20Go\x20Code</a>\x20document\x0aprovides\x20<b>essential\x20setup\x20instructions</b>\x20for\x20using\x20the\x20Go\x20tools.\x0a</p>\x0a\x0a\x0a<h2\x20id=\"tools\">Install\x20additional\x20tools</h2>\x0a\x0a<p>\x0aThe\x20source\x20code\x20for\x20several\x20Go\x20tools\x20(including\x20<a\x20href=\"/cmd/godoc/\">godoc</a>)\x0ais\x20kept\x20in\x20<a\x20href=\"https://golang.org/x/tools\">the\x20go.tools\x20repository</a>.\x0aTo\x20install\x20one\x20of\x20the\x20tools\x20(<code>godoc</code>\x20in\x20this\x20case):\x0a</p>\x0a\x0a<pre>\x0a$\x20go\x20get\x20golang.org/x/tools/cmd/godoc\x0a</pre>\x0a\x0a<p>\x0aTo\x20install\x20these\x20tools,\x20the\x20<code>go</code>\x20<code>get</code>\x20command\x20requires\x0athat\x20<a\x20href=\"#git\">Git</a>\x20be\x20installed\x20locally.\x0a</p>\x0a\x0a<p>\x0aYou\x20must\x20also\x20have\x20a\x20workspace\x20(<code>GOPATH</code>)\x20set\x20up;\x0asee\x20<a\x20href=\"/doc/code.html\">How\x20to\x20Write\x20Go\x20Code</a>\x20for\x20the\x20details.\x0a</p>\x0a\x0a<h2\x20id=\"community\">Community\x20resources</h2>\x0a\x0a<p>\x0aThe\x20usual\x20community\x20resources\x20such\x20as\x0a<code>#go-nuts</code>\x20on\x20the\x20<a\x20href=\"https://freenode.net/\">Freenode</a>\x20IRC\x20server\x0aand\x20the\x0a<a\x20href=\"//groups.google.com/group/golang-nuts\">Go\x20Nuts</a>\x0amailing\x20list\x20have\x20active\x20developers\x20that\x20can\x20help\x20you\x20with\x20problems\x0awith\x20your\x20installation\x20or\x20your\x20development\x20work.\x0aFor\x20those\x20who\x20wish\x20to\x20keep\x20up\x20to\x20date,\x0athere\x20is\x20another\x20mailing\x20list,\x20<a\x20href=\"//groups.google.com/group/golang-checkins\">golang-checkins</a>,\x0athat\x20receives\x20a\x20message\x20summarizing\x20each\x20checkin\x20to\x20the\x20Go\x20repository.\x0a</p>\x0a\x0a<p>\x0aBugs\x20can\x20be\x20reported\x20using\x20the\x20<a\x20href=\"//golang.org/issue/new\">Go\x20issue\x20tracker</a>.\x0a</p>\x0a\x0a\x0a<h2\x20id=\"releases\">Keeping\x20up\x20with\x20releases</h2>\x0a\x0a<p>\x0aNew\x20releases\x20are\x20announced\x20on\x20the\x0a<a\x20href=\"//groups.google.com/group/golang-announce\">golang-announce</a>\x0amailing\x20list.\x0aEach\x20announcement\x20mentions\x20the\x20latest\x20release\x20tag,\x20for\x20instance,\x0a<code\x20class=\"versionTag\">go1.9</code>.\x0a</p>\x0a\x0a<p>\x0aTo\x20update\x20an\x20existing\x20tree\x20to\x20the\x20latest\x20release,\x20you\x20can\x20run:\x0a</p>\x0a\x0a<pre>\x0a$\x20cd\x20go/src\x0a$\x20git\x20fetch\x0a$\x20git\x20checkout\x20<span\x20class=\"versionTag\"><i>&lt;tag&gt;</i></psan>\x0a$\x20./all.bash\x0a</pre>\x0a\x0a<p\x20class=\"whereTag\">\x0aWhere\x20<code>&lt;tag&gt;</code>\x20is\x20the\x20version\x20string\x20of\x20the\x20release.\x0a</p>\x0a\x0a\x0a<h2\x20id=\"environment\">Optional\x20environment\x20variables</h2>\x0a\x0a<p>\x0aThe\x20Go\x20compilation\x20environment\x20can\x20be\x20customized\x20by\x20environment\x20variables.\x0a<i>None\x20is\x20required\x20by\x20the\x20build</i>,\x20but\x20you\x20may\x20wish\x20to\x20set\x20some\x0ato\x20override\x20the\x20defaults.\x0a</p>\x0a\x0a<ul>\x0a<li><code>$GOROOT</code>\x0a<p>\x0aThe\x20root\x20of\x20the\x20Go\x20tree,\x20often\x20<code>$HOME/go1.X</code>.\x0aIts\x20value\x20is\x20built\x20into\x20the\x20tree\x20when\x20it\x20is\x20compiled,\x20and\x0adefaults\x20to\x20the\x20parent\x20of\x20the\x20directory\x20where\x20<code>all.bash</code>\x20was\x20run.\x0aThere\x20is\x20no\x20need\x20to\x20set\x20this\x20unless\x20you\x20want\x20to\x20switch\x20between\x20multiple\x0alocal\x20copies\x20of\x20the\x20repository.\x0a</p>\x0a</li>\x0a\x0a<li><code>$GOROOT_FINAL</code>\x0a<p>\x0aThe\x20value\x20assumed\x20by\x20installed\x20binaries\x20and\x20scripts\x20when\x0a<code>$GOROOT</code>\x20is\x20not\x20set\x20explicitly.\x0aIt\x20defaults\x20to\x20the\x20value\x20of\x20<code>$GOROOT</code>.\x0aIf\x20you\x20want\x20to\x20build\x20the\x20Go\x20tree\x20in\x20one\x20location\x0abut\x20move\x20it\x20elsewhere\x20after\x20the\x20build,\x20set\x0a<code>$GOROOT_FINAL</code>\x20to\x20the\x20eventual\x20location.\x0a</p>\x0a</li>\x0a\x0a<li\x20id=\"gopath\"><code>$GOPATH</code>\x0a<p>\x0aThe\x20directory\x20where\x20Go\x20projects\x20outside\x20the\x20Go\x20distribution\x20are\x20typically\x0achecked\x20out.\x20For\x20example,\x20<code>golang.org/x/tools</code>\x20might\x20be\x20checked\x20out\x0ato\x20<code>$GOPATH/src/golang.org/x/tools</code>.\x20Executables\x20outside\x20the\x0aGo\x20distribution\x20are\x20installed\x20in\x20<code>$GOPATH/bin</code>\x20(or\x0a<code>$GOBIN</code>,\x20if\x20set).\x20Modules\x20are\x20downloaded\x20and\x20cached\x20in\x0a<code>$GOPATH/pkg/mod</code>.\x0a</p>\x0a\x0a<p>The\x20default\x20location\x20of\x20<code>$GOPATH</code>\x20is\x20<code>$HOME/go</code>,\x0aand\x20it's\x20not\x20usually\x20necessary\x20to\x20set\x20<code>GOPATH</code>\x20explicitly.\x20However,\x0aif\x20you\x20have\x20checked\x20out\x20the\x20Go\x20distribution\x20to\x20<code>$HOME/go</code>,\x0ayou\x20must\x20set\x20<code>GOPATH</code>\x20to\x20another\x20location\x20to\x20avoid\x20conflicts.\x0a</p>\x0a</li>\x0a\x0a<li><code>$GOBIN</code>\x0a<p>\x0aThe\x20directory\x20where\x20executables\x20outside\x20the\x20Go\x20distribution\x20are\x20installed\x0ausing\x20the\x20<a\x20href=\"/cmd/go\">go\x20command</a>.\x20For\x20example,\x0a<code>go\x20get\x20golang.org/x/tools/cmd/godoc</code>\x20downloads,\x20builds,\x20and\x0ainstalls\x20<code>$GOBIN/godoc</code>.\x20By\x20default,\x20<code>$GOBIN</code>\x20is\x0a<code>$GOPATH/bin</code>\x20(or\x20<code>$HOME/go/bin</code>\x20if\x20<code>GOPATH</code>\x0ais\x20not\x20set).\x20After\x20installing,\x20you\x20will\x20want\x20to\x20add\x20this\x20directory\x20to\x0ayour\x20<code>$PATH</code>\x20so\x20you\x20can\x20use\x20installed\x20tools.\x0a</p>\x0a\x0a<p>\x0aNote\x20that\x20the\x20Go\x20distribution's\x20executables\x20are\x20installed\x20in\x0a<code>$GOROOT/bin</code>\x20(for\x20executables\x20invoked\x20by\x20people)\x20or\x0a<code>$GOTOOLDIR</code>\x20(for\x20executables\x20invoked\x20by\x20the\x20go\x20command;\x0adefaults\x20to\x20<code>$GOROOT/pkg/$GOOS_GOARCH</code>)\x20instead\x20of\x0a<code>$GOBIN</code>.\x0a</p>\x0a</li>\x0a\x0a<li><code>$GOOS</code>\x20and\x20<code>$GOARCH</code>\x0a<p>\x0aThe\x20name\x20of\x20the\x20target\x20operating\x20system\x20and\x20compilation\x20architecture.\x0aThese\x20default\x20to\x20the\x20values\x20of\x20<code>$GOHOSTOS</code>\x20and\x0a<code>$GOHOSTARCH</code>\x20respectively\x20(described\x20below).\x0a</li>\x0a\x0a<p>\x0aChoices\x20for\x20<code>$GOOS</code>\x20are\x0a<code>android</code>,\x20<code>darwin</code>\x20(macOS/iOS),\x0a<code>dragonfly</code>,\x20<code>freebsd</code>,\x20<code>illumos</code>,\x20<code>js</code>,\x0a<code>linux</code>,\x20<code>netbsd</code>,\x20<code>openbsd</code>,\x0a<code>plan9</code>,\x20<code>solaris</code>\x20and\x20<code>windows</code>.\x0a</p>\x0a\x0a<p>\x0aChoices\x20for\x20<code>$GOARCH</code>\x20are\x0a<code>amd64</code>\x20(64-bit\x20x86,\x20the\x20most\x20mature\x20port),\x0a<code>386</code>\x20(32-bit\x20x86),\x20<code>arm</code>\x20(32-bit\x20ARM),\x20<code>arm64</code>\x20(64-bit\x20ARM),\x0a<code>ppc64le</code>\x20(PowerPC\x2064-bit,\x20little-endian),\x20<code>ppc64</code>\x20(PowerPC\x2064-bit,\x20big-endian),\x0a<code>mips64le</code>\x20(MIPS\x2064-bit,\x20little-endian),\x20<code>mips64</code>\x20(MIPS\x2064-bit,\x20big-endian),\x0a<code>mipsle</code>\x20(MIPS\x2032-bit,\x20little-endian),\x20<code>mips</code>\x20(MIPS\x2032-bit,\x20big-endian),\x0a<code>s390x</code>\x20(IBM\x20System\x20z\x2064-bit,\x20big-endian),\x20and\x0a<code>wasm</code>\x20(WebAssembly\x2032-bit).\x0a</p>\x0a\x0a<p>\x0aThe\x20valid\x20combinations\x20of\x20<code>$GOOS</code>\x20and\x20<code>$GOARCH</code>\x20are:\x0a<table\x20cellpadding=\"0\">\x0a<tr>\x0a<th\x20width=\"50\"></th><th\x20align=\"left\"\x20width=\"100\"><code>$GOOS</code></th>\x20<th\x20align=\"left\"\x20width=\"100\"><code>$GOARCH</code></th>\x0a</tr>\x0a<tr>\x0a<td></td><td><code>aix</code></td>\x20<td><code>ppc64</code></td>\x0a</tr>\x0a<tr>\x0a<td></td><td><code>android</code></td>\x20<td><code>386</code></td>\x0a</tr>\x0a<tr>\x0a<td></td><td><code>android</code></td>\x20<td><code>amd64</code></td>\x0a</tr>\x0a<tr>\x0a<td></td><td><code>android</code></td>\x20<td><code>arm</code></td>\x0a</tr>\x0a<tr>\x0a<td></td><td><code>android</code></td>\x20<td><code>arm64</code></td>\x0a</tr>\x0a<tr>\x0a<td></td><td><code>darwin</code></td>\x20<td><code>amd64</code></td>\x0a</tr>\x0a<tr>\x0a<td></td><td><code>darwin</code></td>\x20<td><code>arm64</code></td>\x0a</tr>\x0a<tr>\x0a<td></td><td><code>dragonfly</code></td>\x20<td><code>amd64</code></td>\x0a</tr>\x0a<tr>\x0a<td></td><td><code>freebsd</code></td>\x20<td><code>386</code></td>\x0a</tr>\x0a<tr>\x0a<td></td><td><code>freebsd</code></td>\x20<td><code>amd64</code></td>\x0a</tr>\x0a<tr>\x0a<td></td><td><code>freebsd</code></td>\x20<td><code>arm</code></td>\x0a</tr>\x0a<tr>\x0a<td></td><td><code>illumos</code></td>\x20<td><code>amd64</code></td>\x0a</tr>\x0a<tr>\x0a<td></td><td><code>js</code></td>\x20<td><code>wasm</code></td>\x0a</tr>\x0a<tr>\x0a<td></td><td><code>linux</code></td>\x20<td><code>386</code></td>\x0a</tr>\x0a<tr>\x0a<td></td><td><code>linux</code></td>\x20<td><code>amd64</code></td>\x0a</tr>\x0a<tr>\x0a<td></td><td><code>linux</code></td>\x20<td><code>arm</code></td>\x0a</tr>\x0a<tr>\x0a<td></td><td><code>linux</code></td>\x20<td><code>arm64</code></td>\x0a</tr>\x0a<tr>\x0a<td></td><td><code>linux</code></td>\x20<td><code>ppc64</code></td>\x0a</tr>\x0a<tr>\x0a<td></td><td><code>linux</code></td>\x20<td><code>ppc64le</code></td>\x0a</tr>\x0a<tr>\x0a<td></td><td><code>linux</code></td>\x20<td><code>mips</code></td>\x0a</tr>\x0a<tr>\x0a<td></td><td><code>linux</code></td>\x20<td><code>mipsle</code></td>\x0a</tr>\x0a<tr>\x0a<td></td><td><code>linux</code></td>\x20<td><code>mips64</code></td>\x0a</tr>\x0a<tr>\x0a<td></td><td><code>linux</code></td>\x20<td><code>mips64le</code></td>\x0a</tr>\x0a<tr>\x0a<td></td><td><code>linux</code></td>\x20<td><code>s390x</code></td>\x0a</tr>\x0a<tr>\x0a<td></td><td><code>netbsd</code></td>\x20<td><code>386</code></td>\x0a</tr>\x0a<tr>\x0a<td></td><td><code>netbsd</code></td>\x20<td><code>amd64</code></td>\x0a</tr>\x0a<tr>\x0a<td></td><td><code>netbsd</code></td>\x20<td><code>arm</code></td>\x0a</tr>\x0a<tr>\x0a<td></td><td><code>openbsd</code></td>\x20<td><code>386</code></td>\x0a</tr>\x0a<tr>\x0a<td></td><td><code>openbsd</code></td>\x20<td><code>amd64</code></td>\x0a</tr>\x0a<tr>\x0a<td></td><td><code>openbsd</code></td>\x20<td><code>arm</code></td>\x0a</tr>\x0a<tr>\x0a<td></td><td><code>openbsd</code></td>\x20<td><code>arm64</code></td>\x0a</tr>\x0a<tr>\x0a<td></td><td><code>plan9</code></td>\x20<td><code>386</code></td>\x0a</tr>\x0a<tr>\x0a<td></td><td><code>plan9</code></td>\x20<td><code>amd64</code></td>\x0a</tr>\x0a<tr>\x0a<td></td><td><code>plan9</code></td>\x20<td><code>arm</code></td>\x0a</tr>\x0a<tr>\x0a<td></td><td><code>solaris</code></td>\x20<td><code>amd64</code></td>\x0a</tr>\x0a<tr>\x0a<td></td><td><code>windows</code></td>\x20<td><code>386</code></td>\x0a</tr>\x0a<tr>\x0a<td></td><td><code>windows</code></td>\x20<td><code>amd64</code></td>\x0a</tr>\x0a</table>\x0a<br>\x0a\x0a<li><code>$GOHOSTOS</code>\x20and\x20<code>$GOHOSTARCH</code>\x0a<p>\x0aThe\x20name\x20of\x20the\x20host\x20operating\x20system\x20and\x20compilation\x20architecture.\x0aThese\x20default\x20to\x20the\x20local\x20system's\x20operating\x20system\x20and\x0aarchitecture.\x0a</p>\x0a</li>\x0a\x0a<p>\x0aValid\x20choices\x20are\x20the\x20same\x20as\x20for\x20<code>$GOOS</code>\x20and\x0a<code>$GOARCH</code>,\x20listed\x20above.\x0aThe\x20specified\x20values\x20must\x20be\x20compatible\x20with\x20the\x20local\x20system.\x0aFor\x20example,\x20you\x20should\x20not\x20set\x20<code>$GOHOSTARCH</code>\x20to\x0a<code>arm</code>\x20on\x20an\x20x86\x20system.\x0a</p>\x0a\x0a<li><code>$GO386</code>\x20(for\x20<code>386</code>\x20only,\x20default\x20is\x20auto-detected\x0aif\x20built\x20on\x20either\x20<code>386</code>\x20or\x20<code>amd64</code>,\x20<code>387</code>\x20otherwise)\x0a<p>\x0aThis\x20controls\x20the\x20code\x20generated\x20by\x20gc\x20to\x20use\x20either\x20the\x20387\x20floating-point\x20unit\x0a(set\x20to\x20<code>387</code>)\x20or\x20SSE2\x20instructions\x20(set\x20to\x20<code>sse2</code>)\x20for\x0afloating\x20point\x20computations.\x0a</p>\x0a<ul>\x0a\x09<li><code>GO386=387</code>:\x20use\x20x87\x20for\x20floating\x20point\x20operations;\x20should\x20support\x20all\x20x86\x20chips\x20(Pentium\x20MMX\x20or\x20later).</li>\x0a\x09<li><code>GO386=sse2</code>:\x20use\x20SSE2\x20for\x20floating\x20point\x20operations;\x20has\x20better\x20performance\x20than\x20387,\x20but\x20only\x20available\x20on\x20Pentium\x204/Opteron/Athlon\x2064\x20or\x20later.</li>\x0a</ul>\x0a</li>\x0a\x0a<li><code>$GOARM</code>\x20(for\x20<code>arm</code>\x20only;\x20default\x20is\x20auto-detected\x20if\x20building\x0aon\x20the\x20target\x20processor,\x206\x20if\x20not)\x0a<p>\x0aThis\x20sets\x20the\x20ARM\x20floating\x20point\x20co-processor\x20architecture\x20version\x20the\x20run-time\x0ashould\x20target.\x20If\x20you\x20are\x20compiling\x20on\x20the\x20target\x20system,\x20its\x20value\x20will\x20be\x20auto-detected.\x0a</p>\x0a<ul>\x0a\x09<li><code>GOARM=5</code>:\x20use\x20software\x20floating\x20point;\x20when\x20CPU\x20doesn't\x20have\x20VFP\x20co-processor</li>\x0a\x09<li><code>GOARM=6</code>:\x20use\x20VFPv1\x20only;\x20default\x20if\x20cross\x20compiling;\x20usually\x20ARM11\x20or\x20better\x20cores\x20(VFPv2\x20or\x20better\x20is\x20also\x20supported)</li>\x0a\x09<li><code>GOARM=7</code>:\x20use\x20VFPv3;\x20usually\x20Cortex-A\x20cores</li>\x0a</ul>\x0a<p>\x0aIf\x20in\x20doubt,\x20leave\x20this\x20variable\x20unset,\x20and\x20adjust\x20it\x20if\x20required\x0awhen\x20you\x20first\x20run\x20the\x20Go\x20executable.\x0aThe\x20<a\x20href=\"//golang.org/wiki/GoArm\">GoARM</a>\x20page\x0aon\x20the\x20<a\x20href=\"//golang.org/wiki\">Go\x20community\x20wiki</a>\x0acontains\x20further\x20details\x20regarding\x20Go's\x20ARM\x20support.\x0a</p>\x0a</li>\x0a\x0a<li><code>$GOMIPS</code>\x20(for\x20<code>mips</code>\x20and\x20<code>mipsle</code>\x20only)\x20<br>\x20<code>$GOMIPS64</code>\x20(for\x20<code>mips64</code>\x20and\x20<code>mips64le</code>\x20only)\x0a<p>\x0a\x09These\x20variables\x20set\x20whether\x20to\x20use\x20floating\x20point\x20instructions.\x20Set\x20to\x20\"<code>hardfloat</code>\"\x20to\x20use\x20floating\x20point\x20instructions;\x20this\x20is\x20the\x20default.\x20\x20Set\x20to\x20\"<code>softfloat</code>\"\x20to\x20use\x20soft\x20floating\x20point.\x0a</p>\x0a</li>\x0a\x0a<li><code>$GOPPC64</code>\x20(for\x20<code>ppc64</code>\x20and\x20<code>ppc64le</code>\x20only)\x0a<p>\x0aThis\x20variable\x20sets\x20the\x20processor\x20level\x20(i.e.\x20Instruction\x20Set\x20Architecture\x20version)\x0afor\x20which\x20the\x20compiler\x20will\x20target.\x20The\x20default\x20is\x20<code>power8</code>.\x0a</p>\x0a<ul>\x0a\x09<li><code>GOPPC64=power8</code>:\x20generate\x20ISA\x20v2.07\x20instructions</li>\x0a\x09<li><code>GOPPC64=power9</code>:\x20generate\x20ISA\x20v3.00\x20instructions</li>\x0a</ul>\x0a</li>\x0a\x0a\x0a<li><code>$GOWASM</code>\x20(for\x20<code>wasm</code>\x20only)\x0a\x09<p>\x0a\x09This\x20variable\x20is\x20a\x20comma\x20separated\x20list\x20of\x20<a\x20href=\"https://github.com/WebAssembly/proposals\">experimental\x20WebAssembly\x20features</a>\x20that\x20the\x20compiled\x20WebAssembly\x20binary\x20is\x20allowed\x20to\x20use.\x0a\x09The\x20default\x20is\x20to\x20use\x20no\x20experimental\x20features.\x0a\x09</p>\x0a\x09<ul>\x0a\x09\x09<li><code>GOWASM=satconv</code>:\x20generate\x20<a\x20href=\"https://github.com/WebAssembly/nontrapping-float-to-int-conversions/blob/master/proposals/nontrapping-float-to-int-conversion/Overview.md\">saturating\x20(non-trapping)\x20float-to-int\x20conversions</a></li>\x0a\x09\x09<li><code>GOWASM=signext</code>:\x20generate\x20<a\x20href=\"https://github.com/WebAssembly/sign-extension-ops/blob/master/proposals/sign-extension-ops/Overview.md\">sign-extension\x20operators</a></li>\x0a\x09</ul>\x0a</li>\x0a\x0a</ul>\x0a\x0a<p>\x0aNote\x20that\x20<code>$GOARCH</code>\x20and\x20<code>$GOOS</code>\x20identify\x20the\x0a<em>target</em>\x20environment,\x20not\x20the\x20environment\x20you\x20are\x20running\x20on.\x0aIn\x20effect,\x20you\x20are\x20always\x20cross-compiling.\x0aBy\x20architecture,\x20we\x20mean\x20the\x20kind\x20of\x20binaries\x0athat\x20the\x20target\x20environment\x20can\x20run:\x0aan\x20x86-64\x20system\x20running\x20a\x2032-bit-only\x20operating\x20system\x0amust\x20set\x20<code>GOARCH</code>\x20to\x20<code>386</code>,\x0anot\x20<code>amd64</code>.\x0a</p>\x0a\x0a<p>\x0aIf\x20you\x20choose\x20to\x20override\x20the\x20defaults,\x0aset\x20these\x20variables\x20in\x20your\x20shell\x20profile\x20(<code>$HOME/.bashrc</code>,\x0a<code>$HOME/.profile</code>,\x20or\x20equivalent).\x20The\x20settings\x20might\x20look\x0asomething\x20like\x20this:\x0a</p>\x0a\x0a<pre>\x0aexport\x20GOARCH=amd64\x0aexport\x20GOOS=linux\x0a</pre>\x0a\x0a<p>\x0aalthough,\x20to\x20reiterate,\x20none\x20of\x20these\x20variables\x20needs\x20to\x20be\x20set\x20to\x20build,\x0ainstall,\x20and\x20develop\x20the\x20Go\x20tree.\x0a</p>\x0a",