blob: 6000c1a1a7e9f578054dbc6965405f7e5db6baae [file] [log] [blame]
{{/* This template is combined with other templates to render blog pages. */}}
{{define "root"}}
<!DOCTYPE html>
<html lang="en">
{{.AnalyticsHTML}}<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="theme-color" content="#00ADD8">
<meta name="description" content="Go is an open source programming language that makes it easy to build simple, reliable, and efficient software.">
<title>{{template "title" .}}</title>
<link rel="stylesheet" href="|Roboto:400,700|Source+Code+Pro">
<link rel="stylesheet" href="">
<link rel="stylesheet" href="/lib/godoc/style.css">
<link rel="stylesheet" href="/fonts.css">
<link rel="alternate" type="application/atom+xml" title=" - Atom Feed" href="" />
<script>window.initFuncs = [];</script>
h6 {
font-family: 'Work Sans', sans-serif;
font-weight: 600;
h2 { /* Reset from style.js in x/website */
background: none;
clear: none;
font-size: 1.5em;
font-weight: 600;
line-height: inherit;
overflow-wrap: normal;
padding: 0;
a.head {
color: black;
text-decoration: none !important;
a.head:hover {
text-decoration: underline;
@media print {
#sidebar { display: none; }
#sidebar {
float: right;
padding-left: 20px;
width: 40%;
max-width: 250px;
background: #f8f9f9;
margin: 20px 0 20px 20px;
#sidebar h2 {
font-size: 1rem;
#sidebar ul {
padding: 0;
#sidebar li {
list-style-type: none;
#content .author {
font-style: italic;
#content .article {
margin-bottom: 50px;
#content .date {
color: #6e7072;
#content .tags {
color: #999;
font-size: smaller;
#content .iframe, #content .image {
margin: 20px;
#content .title {
margin: 20px 0;
#content img {
max-width: 100%;
.article[data-slug='/go-fonts'] {
font-family: Go, sans-serif;
.article[data-slug='/go-fonts'] pre,
.article[data-slug='/go-fonts'] code {
font-family: 'Go Mono', monospace;
<body class="Site">
<header class="Header js-header">
<div class="Header-banner">
Black Lives Matter.
<a href="!/donation/checkout"
rel="noopener">Support the Equal Justice Initiative.</a>
<nav class="Header-nav">
<a href="{{.GodocURL}}"><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">
<ul class="Header-menu">
<li class="Header-menuItem"><a href="{{.GodocURL}}/doc/">Documents</a></li>
<li class="Header-menuItem"><a href="{{.GodocURL}}/pkg/">Packages</a></li>
<li class="Header-menuItem"><a href="{{.GodocURL}}/project/">The Project</a></li>
<li class="Header-menuItem"><a href="{{.GodocURL}}/help/">Help</a></li>
<li class="Header-menuItem"><a href="{{.BasePath}}/">Blog</a></li>
<li class="Header-menuItem"><a href="">Play</a></li>
<main class="Site-content" id="page">
<div class="container">
<aside id="sidebar">
{{with .Doc}}
{{with .Newer}}
<h2>Next article</h2>
<p><a href="{{.Path}}">{{.Title}}</a></p>
{{with .Older}}
<h2>Previous article</h2>
<p><a href="{{.Path}}">{{.Title}}</a></p>
<li><a href='//'></a></li>
<li><a href='//'>Install Go</a></li>
<li><a href='//'>A Tour of Go</a></li>
<li><a href='//'>Go Documentation</a></li>
<li><a href='//'>Go Mailing List</a></li>
<li><a href='//'>Go on Twitter</a></li>
<p><a href="{{.BasePath}}/index">Blog index</a></p>
</aside><!-- #sidebar -->
<div id="content">
<h1><a href="{{.BasePath}}/">The Go Blog</a></h1>
{{template "content" .}}
</div><!-- #content -->
</div><!-- .container -->
</main><!-- #page -->
<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="{{.GodocURL}}/doc/copyright.html">Copyright</a></li>
<li class="Footer-link"><a href="{{.GodocURL}}/doc/tos.html">Terms of Service</a></li>
<li class="Footer-link"><a href="">Privacy Policy</a></li>
<li class="Footer-link"><a href="" target="_blank" rel="noopener">Report issue</a></li>
<a class="Footer-supportedBy" href="">Supported by Google</a>
<script src="/lib/godoc/jquery.js"></script>
<script src="/lib/godoc/playground.js"></script>
<script src="/lib/godoc/play.js"></script>
<script src="/lib/godoc/godocs.js"></script>
$(function() {
// Insert line numbers for all playground elements.
$('.playground > pre.numbers, .code > pre.numbers').each(function() {
var $spans = $(this).find('> span');
// Compute width of number column (including trailing space).
var max = 0;
$spans.each(function() {
var n = $(this).attr('num')*1;
if (n > max) max = n;
var width = 2;
while (max > 10) {
max = max / 10;
// Insert line numbers with space padding.
$spans.each(function() {
var n = $(this).attr('num')+' ';
while (n.length < width) n = ' '+n;
$('<span class="number">').text(n).insertBefore(this);
initPlayground(new HTTPTransport());
{{define "doc"}}
<div class="article" data-slug="{{.Path}}">
<h2 class="title"><a href="{{.Path}}">{{.Title}}</a></h2>
<p class="author">
{{with .Authors}}{{authors .}}<br>{{end}}
{{.Time.Format "2 January 2006"}}