2012-01-19 13:37:36 -07:00
|
|
|
<!--{
|
2015-09-01 18:46:05 -06:00
|
|
|
"Path": "/",
|
|
|
|
"Template": true
|
2012-01-19 13:37:36 -07:00
|
|
|
}-->
|
|
|
|
|
2012-03-04 16:34:22 -07:00
|
|
|
<div class="left">
|
2012-02-13 03:22:36 -07:00
|
|
|
|
|
|
|
<div id="learn">
|
2017-08-02 14:31:46 -06:00
|
|
|
{{if not $.GoogleCN}}
|
2013-09-15 23:47:13 -06:00
|
|
|
<a class="popout share">Pop-out</a>
|
2017-08-02 14:31:46 -06:00
|
|
|
{{end}}
|
2012-02-13 03:22:36 -07:00
|
|
|
<div class="rootHeading">Try Go</div>
|
|
|
|
<div class="input">
|
2012-03-12 18:00:11 -06:00
|
|
|
<textarea spellcheck="false" class="code">// You can edit this code!
|
2012-02-13 03:22:36 -07:00
|
|
|
// Click here and start typing.
|
|
|
|
package main
|
|
|
|
|
|
|
|
import "fmt"
|
|
|
|
|
|
|
|
func main() {
|
|
|
|
fmt.Println("Hello, 世界")
|
|
|
|
}</textarea>
|
|
|
|
</div>
|
2012-03-12 18:00:11 -06:00
|
|
|
<div class="output">
|
2012-02-13 03:22:36 -07:00
|
|
|
<pre>
|
|
|
|
Hello, 世界
|
|
|
|
</pre>
|
|
|
|
</div>
|
|
|
|
<div class="buttons">
|
2012-03-15 00:44:47 -06:00
|
|
|
<a class="run" href="#" title="Run this code [shift-enter]">Run</a>
|
2017-08-02 14:31:46 -06:00
|
|
|
{{if not $.GoogleCN}}
|
2012-03-15 00:44:47 -06:00
|
|
|
<a class="share" href="#" title="Share this code">Share</a>
|
2014-07-24 18:28:39 -06:00
|
|
|
<a class="tour" href="//tour.golang.org/" title="Learn Go from your browser">Tour</a>
|
2017-08-02 14:31:46 -06:00
|
|
|
{{end}}
|
2012-03-15 00:44:47 -06:00
|
|
|
</div>
|
|
|
|
<div class="toys">
|
|
|
|
<select>
|
|
|
|
<option value="hello.go">Hello, World!</option>
|
2013-06-03 20:59:28 -06:00
|
|
|
<option value="life.go">Conway's Game of Life</option>
|
2012-03-15 00:44:47 -06:00
|
|
|
<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>
|
2012-02-13 03:22:36 -07:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
2012-03-04 16:34:22 -07:00
|
|
|
<div class="right">
|
|
|
|
|
|
|
|
<div id="about">
|
2013-10-29 00:56:38 -06:00
|
|
|
Go is an open source programming language that makes it easy to build
|
2012-03-04 16:34:22 -07:00
|
|
|
simple, reliable, and efficient software.
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div id="gopher"></div>
|
|
|
|
|
2018-01-19 20:47:23 -07:00
|
|
|
<a href="/dl/" id="start">
|
2013-02-28 17:22:13 -07:00
|
|
|
<span class="big">Download Go</span>
|
|
|
|
<span class="desc">
|
2012-03-04 16:34:22 -07:00
|
|
|
Binary distributions available for<br>
|
|
|
|
Linux, Mac OS X, Windows, and more.
|
2013-02-28 17:22:13 -07:00
|
|
|
</span>
|
2012-03-04 16:34:22 -07:00
|
|
|
</a>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
2012-02-13 03:22:36 -07:00
|
|
|
<div style="clear: both"></div>
|
|
|
|
|
2017-08-02 14:31:46 -06:00
|
|
|
{{if not $.GoogleCN}}
|
2012-03-04 16:34:22 -07:00
|
|
|
<div class="left">
|
2017-08-02 14:31:46 -06:00
|
|
|
<div id="video">
|
|
|
|
<div class="rootHeading">Featured video</div>
|
|
|
|
<iframe width="415" height="241" src="//www.youtube.com/embed/ytEkHepK08c" frameborder="0" allowfullscreen></iframe>
|
|
|
|
</div>
|
2012-02-13 03:22:36 -07:00
|
|
|
</div>
|
|
|
|
|
2017-08-03 10:33:26 -06:00
|
|
|
<div class="right">
|
2017-08-02 14:31:46 -06:00
|
|
|
<div id="blog">
|
|
|
|
<div class="rootHeading">Featured articles</div>
|
|
|
|
<div class="read"><a href="//blog.golang.org/">Read more</a></div>
|
|
|
|
</div>
|
2017-08-03 10:33:26 -06:00
|
|
|
</div>
|
|
|
|
{{end}}
|
2012-02-13 03:22:36 -07:00
|
|
|
|
|
|
|
<div style="clear: both;"></div>
|
|
|
|
|
2017-08-02 14:31:46 -06:00
|
|
|
<script>
|
|
|
|
(function() {
|
|
|
|
'use strict';
|
|
|
|
|
2017-08-03 10:33:26 -06:00
|
|
|
window.initFuncs.push(function() {
|
|
|
|
// Set up playground if enabled.
|
|
|
|
if (window.playground) {
|
|
|
|
window.playground({
|
|
|
|
"codeEl": "#learn .code",
|
|
|
|
"outputEl": "#learn .output",
|
|
|
|
"runEl": "#learn .run",
|
|
|
|
"shareEl": "#learn .share",
|
|
|
|
"shareRedirect": "//play.golang.org/p/",
|
|
|
|
"toysEl": "#learn .toys select"
|
|
|
|
});
|
|
|
|
} else {
|
|
|
|
$('#learn').hide()
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
{{if not $.GoogleCN}}
|
|
|
|
|
|
|
|
function readableTime(t) {
|
2017-08-02 14:31:46 -06:00
|
|
|
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();
|
2013-08-21 19:12:44 -06:00
|
|
|
}
|
2012-02-13 03:22:36 -07:00
|
|
|
|
2017-08-02 14:31:46 -06:00
|
|
|
window.feedLoaded = function(result) {
|
|
|
|
var blog = document.getElementById("blog");
|
|
|
|
var read = blog.getElementsByClassName("read")[0];
|
|
|
|
for (var i = 0; i < result.length && i < 2; i++) {
|
|
|
|
var entry = result[i];
|
|
|
|
var title = document.createElement("a");
|
|
|
|
title.className = "title";
|
|
|
|
title.href = entry.Link;
|
|
|
|
title.innerHTML = entry.Title;
|
|
|
|
blog.insertBefore(title, read);
|
|
|
|
var extract = document.createElement("div");
|
|
|
|
extract.className = "extract";
|
|
|
|
extract.innerHTML = entry.Summary;
|
|
|
|
blog.insertBefore(extract, read);
|
|
|
|
var when = document.createElement("div");
|
|
|
|
when.className = "when";
|
|
|
|
when.innerHTML = "Published " + readableTime(entry.Time);
|
|
|
|
blog.insertBefore(when, read);
|
|
|
|
}
|
|
|
|
}
|
2013-05-08 10:23:50 -06:00
|
|
|
|
2017-08-02 14:31:46 -06:00
|
|
|
window.initFuncs.push(function() {
|
|
|
|
// Load blog feed.
|
|
|
|
$('<script/>').attr('text', 'text/javascript')
|
|
|
|
.attr('src', '//blog.golang.org/.json?jsonp=feedLoaded')
|
|
|
|
.appendTo('body');
|
|
|
|
|
|
|
|
// Set the video at random.
|
|
|
|
var videos = [
|
|
|
|
{h: 241, s: "//www.youtube.com/embed/ytEkHepK08c"}, // Tour of Go
|
|
|
|
{h: 241, s: "//www.youtube.com/embed/f6kdp27TYZs"}, // Concurrency Patterns
|
|
|
|
{h: 233, s: "//player.vimeo.com/video/69237265"} // Simple environment
|
|
|
|
];
|
|
|
|
var v = videos[Math.floor(Math.random()*videos.length)];
|
|
|
|
$('#video iframe').attr('height', v.h).attr('src', v.s);
|
|
|
|
});
|
|
|
|
|
|
|
|
{{end}}
|
|
|
|
})();
|
2012-02-13 03:22:36 -07:00
|
|
|
</script>
|