blob: 51cb3890bbd813645b0a0e3ba809187968696fde [file] [log] [blame]
"Template": true
<div class="HomeContainer">
<section class="HomeSection Hero">
<h1 class="Hero-header">
Go is an open source programming language that makes it easy to build
<strong>simple</strong>, <strong>reliable</strong>, and <strong>efficient</strong> software.
<i class="Hero-gopher"></i>
<a href="/dl/" class="Button Button--big HeroDownloadButton">
<img class="HeroDownloadButton-image" src="/lib/godoc/images/cloud-download.svg" alt="">
Download Go
<p class="Hero-description">
Binary distributions available for<br>
Linux, macOS, Windows, and more.
<section class="HomeSection Playground">
<div class="Playground-headerContainer">
<h2 class="HomeSection-header">Try Go</h2>
{{if not $.GoogleCN}}
<a class="Playground-popout js-playgroundShareEl">Open in Playground</a>
<div class="Playground-inputContainer">
<textarea class="Playground-input js-playgroundCodeEl" spellcheck="false" aria-label="Try Go">// You can edit this code!
// Click here and start typing.
package main
import "fmt"
func main() {
fmt.Println("Hello, 世界")
<div class="Playground-outputContainer js-playgroundOutputEl">
<pre class="Playground-output"><noscript>Hello, 世界</noscript></pre>
<div class="Playground-controls">
<select class="Playground-selectExample js-playgroundToysEl" aria-label="Code examples">
<option value="hello.go">Hello, World!</option>
<option value="life.go">Conway's Game of Life</option>
<option value="fib.go">Fibonacci Closure</option>
<option value="peano.go">Peano Integers</option>
<option value="pi.go">Concurrent pi</option>
<option value="sieve.go">Concurrent Prime Sieve</option>
<option value="solitaire.go">Peg Solitaire Solver</option>
<option value="tree.go">Tree Comparison</option>
<div class="Playground-buttons">
<button class="Button Button--primary js-playgroundRunEl" title="Run this code [shift-enter]">Run</button>
<div class="Playground-secondaryButtons">
{{if not $.GoogleCN}}
<button class="Button js-playgroundShareEl" title="Share this code">Share</button>
<a class="Button tour" href="" title="Playground Go from your browser">Tour</a>
{{if not $.GoogleCN}}
<section class="HomeSection Blog js-blogContainerEl">
<h2 class="HomeSection-header">Featured articles</h2>
<div class="Blog-footer js-blogFooterEl"><a class="Button Button--primary" href="">Read more &gt;</a></div>
<section class="HomeSection">
<h2 class="HomeSection-header">Featured video</h2>
<div class="js-videoContainer" style="--aspect-ratio-padding: 58.07%;">
<iframe width="415" height="241" src="" frameborder="0" allowfullscreen></iframe>
(function() {
'use strict';
window.initFuncs.push(function() {
// Set up playground if enabled.
if (window.playground) {
"codeEl": ".js-playgroundCodeEl",
"outputEl": ".js-playgroundOutputEl",
"runEl": ".js-playgroundRunEl",
"shareEl": ".js-playgroundShareEl",
"shareRedirect": "//",
"toysEl": ".js-playgroundToysEl"
// The pre matched below is added by the code above. Style it appropriately.
document.querySelector(".js-playgroundOutputEl pre").classList.add("Playground-output");
} else {
{{if not $.GoogleCN}}
function readableTime(t) {
var m = ["January", "February", "March", "April", "May", "June", "July",
"August", "September", "October", "November", "December"];
var p = t.substring(0, t.indexOf("T")).split("-");
var d = new Date(p[0], p[1]-1, p[2]);
return d.getDate() + " " + m[d.getMonth()] + " " + d.getFullYear();
window.feedLoaded = function(result) {
var read = document.querySelector(".js-blogFooterEl");
for (var i = 0; i < result.length && i < 2; i++) {
var entry = result[i];
var header = document.createElement("h3");
header.className = "Blog-title";
var titleLink = document.createElement("a");
titleLink.href = entry.Link;
titleLink.rel = "noopener";
titleLink.textContent = entry.Title;
read.parentNode.insertBefore(header, read);
var extract = document.createElement("div");
extract.className = "Blog-extract";
extract.innerHTML = entry.Summary;
// Ensure any cross-origin links have rel=noopener set.
var links = extract.querySelectorAll("a");
for (var j = 0; j < links.length; j++) {
links[j].rel = "noopener";
read.parentNode.insertBefore(extract, read);
var when = document.createElement("div");
when.className = "Blog-when";
when.textContent = "Published " + readableTime(entry.Time);
read.parentNode.insertBefore(when, read);
window.initFuncs.push(function() {
// Load blog feed.
.attr("src", "//")
// Set the video at random.
var videos = [
s: "",
title: "dotGo 2015 - Rob Pike - Simplicity is Complicated",
s: "",
title: "GopherCon 2015: Robert Griesemer - The Evolution of Go",
s: "",
title: "Steve Francia - Go: building on the shoulders of giants and stepping on a few toes",
s: "",
title: "Brad Fitzpatrick Go 1.11 and beyond",
s: "",
title: "The Why of Go",
s: "",
title: "GopherCon 2017: Russ Cox - The Future of Go",
var v = videos[Math.floor(Math.random()*videos.length)];
$(".js-videoContainer iframe").attr("src", v.s).attr("title", v.title);
{{end}} {{/* if not .GoogleCN */}}