ref: 61737f59c0ea6595d0eca0e4830cef85433d0778
dir: /domino/godoc/golang.html/
<!DOCTYPE html> <html lang="en"> <meta charset="utf-8"> <meta name="description" content="Go is an open source programming language that makes it easy to build simple, reliable, and efficient software."> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="theme-color" content="#00ADD8"> <title>The Go Programming Language</title> <link href="https://fonts.googleapis.com/css?family=Work+Sans:600|Roboto:400,700" rel="stylesheet"> <link href="https://fonts.googleapis.com/css?family=Product+Sans&text=Supported%20by%20Google&display=swap" rel="stylesheet"> <link type="text/css" rel="stylesheet" href="/lib/godoc/style.css"> <link rel="search" type="application/opensearchdescription+xml" title="godoc" href="/opensearch.xml" /> <script>window.initFuncs = [];</script> <script> var _gaq = _gaq || []; _gaq.push(["_setAccount", "UA-11222381-2"]); window.trackPageview = function() { _gaq.push(["_trackPageview", location.pathname+location.hash]); }; window.trackPageview(); window.trackEvent = function(category, action, opt_label, opt_value, opt_noninteraction) { _gaq.push(["_trackEvent", category, action, opt_label, opt_value, opt_noninteraction]); }; </script> <script src="/lib/godoc/jquery.js" defer></script> <script src="/lib/godoc/playground.js" defer></script> <script>var goVersion = "go1.15.8";</script> <script src="/lib/godoc/godocs.js" defer></script> <body class="Site"> <header class="Header js-header"> <div class="Header-banner"> Black Lives Matter. <a href="https://support.eji.org/give/153413/#!/donation/checkout" target="_blank" rel="noopener">Support the Equal Justice Initiative.</a> </div> <nav class="Header-nav "> <a href="/"><img class="Header-logo" src="/lib/godoc/images/go-logo-blue.svg" alt="Go"></a> <button class="Header-menuButton js-headerMenuButton" aria-label="Main menu" aria-expanded="false"> <div class="Header-menuButtonInner"></div> </button> <ul class="Header-menu"> <li class="Header-menuItem"><a href="/doc/">Documents</a></li> <li class="Header-menuItem"><a href="/pkg/">Packages</a></li> <li class="Header-menuItem"><a href="/project/">The Project</a></li> <li class="Header-menuItem"><a href="/help/">Help</a></li> <li class="Header-menuItem"><a href="/blog/">Blog</a></li> <li class="Header-menuItem"><a href="https://play.golang.org/">Play</a></li> <li class="Header-menuItem Header-menuItem--search"> <form class="HeaderSearch" role="search" action="/search"> <input class="HeaderSearch-input" type="search" name="q" placeholder="Search" aria-label="Search" autocapitalize="off" autocomplete="off" autocorrect="off" spellcheck="false" required> <button class="HeaderSearch-submit"> <!-- magnifying glass: --><svg class="HeaderSearch-icon" width="24" height="24" viewBox="0 0 24 24"><title>Search</title><path d="M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"/><path d="M0 0h24v24H0z" fill="none"/></svg> </button> </form> </li> </ul> </nav> </header> <main id="page" class="Site-content"> <div class="container"> <div id="nav"></div> <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. </h1> <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 </a> <p class="Hero-description"> Binary distributions available for<br> Linux, macOS, Windows, and more. </p> </section> <section class="HomeSection Playground"> <div class="Playground-headerContainer"> <h2 class="HomeSection-header">Try Go</h2> <a class="Playground-popout js-playgroundShareEl">Open in Playground</a> </div> <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, 世界") } </textarea> </div> <div class="Playground-outputContainer js-playgroundOutputEl"> <pre class="Playground-output"><noscript>Hello, 世界</noscript></pre> </div> <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> </select> <div class="Playground-buttons"> <button class="Button Button--primary js-playgroundRunEl" title="Run this code [shift-enter]">Run</button> <div class="Playground-secondaryButtons"> <button class="Button js-playgroundShareEl" title="Share this code">Share</button> <a class="Button tour" href="https://tour.golang.org/" title="Playground Go from your browser">Tour</a> </div> </div> </div> </section> <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="https://blog.golang.org/">Read more ></a></div> </section> <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="https://www.youtube.com/embed/rFejpH_tAHM" frameborder="0" allowfullscreen></iframe> </div> </section> </div> <script> (function() { 'use strict'; window.initFuncs.push(function() { // Set up playground if enabled. if (window.playground) { window.playground({ "codeEl": ".js-playgroundCodeEl", "outputEl": ".js-playgroundOutputEl", "runEl": ".js-playgroundRunEl", "shareEl": ".js-playgroundShareEl", "shareRedirect": "//play.golang.org/p/", "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 { $(".Playground").hide(); } }); 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; header.appendChild(titleLink); 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"; links[j].classList.add("Blog-link"); } 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. $("<script/>") .attr("src", "//blog.golang.org/.json?jsonp=feedLoaded") .appendTo("body"); // Set the video at random. var videos = [ { s: "https://www.youtube.com/embed/rFejpH_tAHM", title: "dotGo 2015 - Rob Pike - Simplicity is Complicated", }, { s: "https://www.youtube.com/embed/0ReKdcpNyQg", title: "GopherCon 2015: Robert Griesemer - The Evolution of Go", }, { s: "https://www.youtube.com/embed/sX8r6zATHGU", title: "Steve Francia - Go: building on the shoulders of giants and stepping on a few toes", }, { s: "https://www.youtube.com/embed/rWJHbh6qO_Y", title: "Brad Fitzpatrick Go 1.11 and beyond", }, { s: "https://www.youtube.com/embed/bmZNaUcwBt4", title: "The Why of Go", }, { s: "https://www.youtube.com/embed/0Zbh_vmAKvk", 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); }); })(); </script> </div><!-- .container --> </main><!-- #page --> <footer> <div class="Footer "> <img class="Footer-gopher" src="/lib/godoc/images/footer-gopher.jpg" alt="The Go Gopher"> <ul class="Footer-links"> <li class="Footer-link"><a href="/doc/copyright.html">Copyright</a></li> <li class="Footer-link"><a href="/doc/tos.html">Terms of Service</a></li> <li class="Footer-link"><a href="http://www.google.com/intl/en/policies/privacy/">Privacy Policy</a></li> <li class="Footer-link"><a href="http://golang.org/issues/new?title=x/website:" target="_blank" rel="noopener">Report a website issue</a></li> </ul> <a class="Footer-supportedBy" href="https://google.com">Supported by Google</a> </div> </footer> <script> (function() { var ga = document.createElement("script"); ga.type = "text/javascript"; ga.async = true; ga.src = ("https:" == document.location.protocol ? "https://ssl" : "http://www") + ".google-analytics.com/ga.js"; var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(ga, s); })(); </script>