blob: 088a0cd195b24babc51bd86349193a053df93827 [file] [log] [blame]
{{define "layout"}}
<article class="Downloads Article">
<h1>{{.title}}</h1>
{{with .dl}}
<p>
After downloading a binary release suitable for your system,
please follow the <a href="/doc/install">installation instructions</a>.
</p>
<p>
If you are building from source,
follow the <a href="/doc/install/source">source installation instructions</a>.
</p>
<p>
See the <a href="/doc/devel/release.html">release history</a> for more
information about Go releases.
</p>
<p>
As of Go 1.13, the go command by default downloads and authenticates
modules using the Go module mirror and Go checksum database run by Google. See
<a href="https://proxy.golang.org/privacy">https://proxy.golang.org/privacy</a>
for privacy information about these services and the
<a href="/cmd/go/">go command documentation</a>
for configuration details including how to disable the use of these servers or use
different ones.
</p>
{{with .Featured}}
<h2 id="featured">Featured downloads</h2>
<div class="downloadWrapper">
{{range .}}
{{template "download" .}}
{{end}}
{{end}}
</div>
<div style="clear: both;"></div>
{{with .Stable}}
<h2 id="stable">Stable versions</h2>
{{template "download-releases" .}}
{{end}}
{{with .Unstable}}
<h2 id="unstable">Unstable version</h2>
{{template "download-releases" .}}
{{end}}
{{with .Archive}}
<div class="toggle" id="archive">
<div class="collapsed">
<h2 class="toggleButton" title="Click to show versions">Archived versions <span class="toggleText">Show</span></h2>
</div>
<div class="expanded">
<h2 class="toggleButton" title="Click to hide versions">Archived versions <span class="toggleText">Hide</span></h2>
{{template "download-releases" .}}
</div>
</div>
{{end}}
{{end}}
</article>
{{end}}
{{define "download-releases"}}
{{range .}}
<div class="toggle{{if .Visible}}Visible{{end}}" id="{{.Version}}">
<div class="collapsed">
<h3 class="toggleButton" title="Click to show downloads for this version">
<span>{{.Version}}</span>
<img class="toggleButton-img" src="/images/icons/arrow-down.svg" width="18" height="18" aria-hidden="true" />
<img class="toggleButton-img toggleButton-img-dark" src="/images/icons/arrow-down-dark.svg" width="18" height="18" aria-hidden="true" />
</h3>
</div>
<div class="expanded">
<h3 class="toggleButton" title="Click to hide downloads for this version">
<span>{{.Version}}</span>
<img class="toggleButton-img" src="/images/icons/arrow-down.svg" width="18" height="18" aria-hidden="true" />
<img class="toggleButton-img toggleButton-img-dark" src="/images/icons/arrow-down-dark.svg" width="18" height="18" aria-hidden="true" />
</h3>
{{if .Stable}}{{else}}
<p>This is an <b>unstable</b> version of Go. Use with caution.</p>
<p>If you already have Go installed, you can install this version by running:</p>
<pre>
go install golang.org/dl/{{.Version}}@latest
</pre>
<p>Then, use the <code>{{.Version}}</code> command instead of the <code>go</code> command to use {{.Version}}.</p>
{{end}}
{{template "download-files" .}}
</div>
</div>
{{end}}
{{end}}
{{define "download-files"}}
<table class="downloadtable">
<thead>
<tr class="first">
<th>File name</th>
<th>Kind</th>
<th>OS</th>
<th>Arch</th>
<th>Size</th>
{{/* Use the checksum type of the first file for the column heading. */}}
<th>{{(index .Files 0).ChecksumType}} Checksum</th>
</tr>
</thead>
{{if .SplitPortTable}}
{{range .Files}}{{if .PrimaryPort}}{{template "download-file" .}}{{end}}{{end}}
{{/* TODO(cbro): add a link to an explanatory doc page */}}
<tr class="first js-togglePorts" aria-expanded="false"><th colspan="6" class="first">Other Ports</th></tr>
{{range .Files}}{{if not .PrimaryPort}}{{template "download-file" .}}{{end}}{{end}}
{{else}}
{{range .Files}}{{template "download-file" .}}{{end}}
{{end}}
</table>
{{end}}
{{define "download-file"}}
<tr class="{{if .Highlight}}highlight{{end}} {{if not .PrimaryPort}}secondary{{end}}">
<td class="filename"><a class="download" href="{{.URL}}">{{.Filename}}</a></td>
<td>{{.PrettyKind}}</td>
<td>{{.PrettyOS}}</td>
<td>{{.PrettyArch}}</td>
<td>{{.PrettySize}}</td>
<td><tt>{{.PrettyChecksum}}</tt></td>
</tr>
{{end}}
{{define "download"}}
<a class="download downloadBox" href="{{.URL}}">
<div class="platform">{{.Platform}}</div>
{{with .Requirements}}<div class="reqs">{{.}}</div>{{end}}
<div class="filename">
<img src="/images/icons/download.svg" aria-hidden="true" width="14" height="13" />
<span>{{.Filename}}</span>
</div>
</a>
{{end}}