| <!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"> |
| {{with (or .tabTitle .title (strings.Trim .URL "/"))}} |
| <title>{{.}} - The Go Programming Language</title> |
| {{else}} |
| <title>The Go Programming Language</title> |
| {{end}} |
| <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"> |
| <script>window.initFuncs = [];</script> |
| {{with googleAnalytics}} |
| <script> |
| var _gaq = _gaq || []; |
| _gaq.push(["_setAccount", "{{.}}"]); |
| 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> |
| {{end}} |
| <script src="/lib/godoc/jquery.js" defer></script> |
| |
| <script src="/lib/godoc/playground.js" defer></script> |
| {{with version}}<script>var goVersion = {{printf "%q" .}};</script>{{end}} |
| <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 {{if .title}}Header-nav--wide{{end}}"> |
| <a href="/"><img class="Header-logo" src="/lib/godoc/images/go-logo-blue.svg" alt="Go"></a> |
| <button class="Header-menuButton js-golangorg-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> |
| {{if not googleCN}} |
| <li class="Header-menuItem"><a href="/blog/">Blog</a></li> |
| <li class="Header-menuItem"><a href="https://play.golang.org/">Play</a></li> |
| {{end}} |
| </ul> |
| </nav> |
| </header> |
| |
| <main id="page" class="Site-content{{if .title}} wide{{end}}"> |
| <div class="container"> |
| |
| {{define "breadcrumb"}} |
| {{$elems := strings.Split (strings.Trim . "/") "/"}} |
| {{$prefix := slice $elems 0 (sub (len $elems) 1)}} |
| {{range $i, $elem := $prefix -}} |
| <a href="/{{strings.Join (slice $prefix 0 (add $i 1)) "/"}}/">{{$elem}}</a>/ |
| {{- end -}} |
| <span class="text-muted">{{strings.Join (slice $elems (len $prefix) (len $elems)) "/"}}</span> |
| {{end}} |
| |
| {{if .title}} |
| <h1>{{.title}}</h1> |
| {{else if eq .layout "error"}} |
| <h1>Error</h1> |
| {{else if eq .layout "dir"}} |
| <h1>Directory {{breadcrumb .URL}}</h1> |
| {{else if and (eq .layout "texthtml") (strings.HasSuffix .URL ".go")}} |
| <h1>Source file {{breadcrumb .URL}}</h1> |
| {{else if eq .layout "texthtml"}} |
| <h1>Text file {{breadcrumb .URL}}</h1> |
| {{end}} |
| |
| {{with .subtitle}} |
| <h2>{{.}}</h2> |
| {{end}} |
| |
| {{if strings.HasPrefix .URL "/src/"}} |
| <h2> |
| Documentation: |
| {{with strings.TrimPrefix .URL "/src/"}} |
| <a href="/pkg/{{.}}">{{.}}</a> |
| {{else}} |
| <a href="/pkg">Index</a> |
| {{end}} |
| </h2> |
| {{end}} |
| |
| {{/* The Table of Contents is automatically inserted in this <div>. |
| Do not delete this <div>. */}} |
| <div id="nav"></div> |
| |
| {{block "layout" .}}{{.Content}}{{end}} |
| |
| </div><!-- .container --> |
| </main><!-- #page --> |
| <footer> |
| <div class="Footer {{if .title}}Footer--wide{{end}}"> |
| <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> |
| {{if googleAnalytics}} |
| <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> |
| {{end}} |