2012-01-19 13:37:36 -07:00
|
|
|
<!--{
|
|
|
|
"Path": "/"
|
|
|
|
}-->
|
|
|
|
|
2012-03-04 16:34:22 -07:00
|
|
|
<div class="left">
|
2012-02-13 03:22:36 -07:00
|
|
|
|
|
|
|
<div id="learn">
|
2012-03-12 19:57:48 -06:00
|
|
|
<img class="icon share" src="/doc/share.png" alt="View full screen" title="View full screen">
|
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>
|
|
|
|
<a class="share" href="#" title="Share this code">Share</a>
|
|
|
|
<a class="tour" href="http://tour.golang.org/" title="Learn Go from your browser">Tour</a>
|
|
|
|
</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">
|
|
|
|
Go is an open source programming environment that makes it easy to build
|
|
|
|
simple, reliable, and efficient software.
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div id="gopher"></div>
|
|
|
|
|
2012-03-04 23:07:10 -07:00
|
|
|
<a href="/doc/install" 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>
|
|
|
|
|
2012-03-04 16:34:22 -07:00
|
|
|
<div class="left">
|
2012-02-13 03:22:36 -07:00
|
|
|
|
|
|
|
<div id="video">
|
|
|
|
<div class="rootHeading">Featured video</div>
|
2012-06-22 11:22:01 -06:00
|
|
|
<iframe width="415" height="241" src="http://www.youtube.com/embed/ytEkHepK08c" frameborder="0" allowfullscreen></iframe>
|
2012-02-13 03:22:36 -07:00
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
2012-03-04 16:34:22 -07:00
|
|
|
<div class="right">
|
2012-02-13 03:22:36 -07:00
|
|
|
|
|
|
|
<div id="blog">
|
|
|
|
<div class="rootHeading">Featured articles</div>
|
|
|
|
<div class="read"><a href="http://blog.golang.org/">Read more</a></div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div style="clear: both;"></div>
|
|
|
|
|
2012-02-14 18:59:50 -07:00
|
|
|
<script type="text/javascript">
|
2013-05-08 10:23:50 -06:00
|
|
|
|
|
|
|
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();
|
|
|
|
}
|
2010-03-19 18:42:57 -06:00
|
|
|
|
2012-02-13 03:22:36 -07:00
|
|
|
function feedLoaded(result) {
|
2012-02-14 18:59:50 -07:00
|
|
|
var blog = document.getElementById("blog");
|
|
|
|
var read = blog.getElementsByClassName("read")[0];
|
2013-05-08 10:23:50 -06:00
|
|
|
for (var i = 0; i < result.length && i < 2; i++) {
|
|
|
|
var entry = result[i];
|
2012-02-14 18:59:50 -07:00
|
|
|
var title = document.createElement("a");
|
|
|
|
title.className = "title";
|
2013-05-08 10:23:50 -06:00
|
|
|
title.href = entry.Link;
|
|
|
|
title.innerHTML = entry.Title;
|
2012-02-14 18:59:50 -07:00
|
|
|
blog.insertBefore(title, read);
|
|
|
|
var extract = document.createElement("div");
|
|
|
|
extract.className = "extract";
|
2013-05-08 10:23:50 -06:00
|
|
|
extract.innerHTML = entry.Summary;
|
2012-02-14 18:59:50 -07:00
|
|
|
blog.insertBefore(extract, read);
|
|
|
|
var when = document.createElement("div");
|
|
|
|
when.className = "when";
|
2013-05-08 10:23:50 -06:00
|
|
|
when.innerHTML = "Published " + readableTime(entry.Time);
|
2012-02-14 18:59:50 -07:00
|
|
|
blog.insertBefore(when, read);
|
|
|
|
}
|
2012-02-13 03:22:36 -07:00
|
|
|
}
|
|
|
|
|
2013-05-08 10:23:50 -06:00
|
|
|
$(function() {
|
2012-02-14 18:59:50 -07:00
|
|
|
// Set up playground.
|
|
|
|
playground({
|
2012-03-12 18:00:11 -06:00
|
|
|
"codeEl": "#learn .code",
|
|
|
|
"outputEl": "#learn .output",
|
|
|
|
"runEl": "#learn .run",
|
|
|
|
"shareEl": "#learn .share",
|
2012-03-15 00:44:47 -06:00
|
|
|
"shareRedirect": "http://play.golang.org/p/",
|
|
|
|
"toysEl": "#learn .toys select"
|
2012-02-14 18:59:50 -07:00
|
|
|
});
|
2012-02-13 03:22:36 -07:00
|
|
|
|
2013-05-08 10:23:50 -06:00
|
|
|
// Load blog feed.
|
|
|
|
$('<script/>').attr('text', 'text/javascript')
|
|
|
|
.attr('src', 'http://blog.golang.org/.json?jsonp=feedLoaded')
|
|
|
|
.appendTo('body');
|
|
|
|
});
|
|
|
|
|
2012-02-13 03:22:36 -07:00
|
|
|
</script>
|