2012-01-19 13:37:36 -07:00
|
|
|
<!--{
|
|
|
|
"Path": "/"
|
|
|
|
}-->
|
|
|
|
|
2012-02-13 03:22:36 -07:00
|
|
|
<div id="left" class="aboutcol">
|
|
|
|
|
|
|
|
<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>
|
|
|
|
|
|
|
|
<a href="/install/" id="start">
|
|
|
|
<div class="big">Download Go</div>
|
|
|
|
<div class="desc">
|
|
|
|
Binary distributions available for<br>
|
|
|
|
Linux, Mac OS X, Windows, and more.
|
|
|
|
</div>
|
|
|
|
</a>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div id="right" class="learncol">
|
|
|
|
|
|
|
|
<div id="learn">
|
|
|
|
<div class="rootHeading">Try Go</div>
|
|
|
|
<div class="input">
|
2012-02-14 18:59:50 -07:00
|
|
|
<textarea spellcheck="false" id="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-02-14 18:59:50 -07:00
|
|
|
<div class="output" id="output">
|
2012-02-13 03:22:36 -07:00
|
|
|
<pre>
|
|
|
|
Hello, 世界
|
|
|
|
</pre>
|
|
|
|
</div>
|
|
|
|
<div class="buttons">
|
2012-02-14 18:59:50 -07:00
|
|
|
<a id="run" href="#">Run</a>
|
|
|
|
<a id="share" href="#">Share</a>
|
2012-02-13 03:22:36 -07:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div style="clear: both"></div>
|
|
|
|
|
|
|
|
<div id="left">
|
|
|
|
|
|
|
|
<div id="video">
|
|
|
|
<div class="rootHeading">Featured video</div>
|
|
|
|
<a class="title" href="http://www.youtube.com/watch?v=Mo1YKpIF1PQ">Building integrated apps on Google's cloud platform with Go</a>
|
|
|
|
<iframe width="415" height="241" src="http://www.youtube.com/embed/Mo1YKpIF1PQ" frameborder="0" allowfullscreen></iframe>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div id="right">
|
|
|
|
|
|
|
|
<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>
|
|
|
|
|
|
|
|
<div id="plusoneRoot"><g:plusone annotation="none"></g:plusone></div>
|
|
|
|
|
|
|
|
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
|
2012-02-14 18:59:50 -07:00
|
|
|
<script type="text/javascript" src="/doc/play/playground.js"></script>
|
|
|
|
<script type="text/javascript">
|
2010-03-19 18:42:57 -06:00
|
|
|
google.load("feeds", "1");
|
2012-02-14 18:59:50 -07:00
|
|
|
google.load("jquery", "1.7.1");
|
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
|
|
|
if (result.error) {
|
|
|
|
console.log(result.error);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
var blog = document.getElementById("blog");
|
|
|
|
var read = blog.getElementsByClassName("read")[0];
|
|
|
|
for (var i = 0; i < result.feed.entries.length && i < 2; i++) {
|
|
|
|
var entry = result.feed.entries[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.contentSnippet;
|
|
|
|
blog.insertBefore(extract, read);
|
|
|
|
var when = document.createElement("div");
|
|
|
|
when.className = "when";
|
|
|
|
var pub = entry.publishedDate.split(" ").slice(1,3).join(" ");
|
|
|
|
when.innerHTML = "Published " + pub
|
|
|
|
blog.insertBefore(when, read);
|
|
|
|
}
|
2012-02-13 03:22:36 -07:00
|
|
|
}
|
|
|
|
|
2012-02-14 18:59:50 -07:00
|
|
|
function init() {
|
|
|
|
// Load blog feed.
|
|
|
|
var feed = new google.feeds.Feed("http://blog.golang.org/feeds/posts/default");
|
|
|
|
feed.load(feedLoaded);
|
|
|
|
|
|
|
|
// Set up playground.
|
|
|
|
playground({
|
2012-02-21 15:16:54 -07:00
|
|
|
"simple": true,
|
|
|
|
"codeEl": "#code",
|
|
|
|
"outputEl": "#output",
|
|
|
|
"runEl": "#run",
|
|
|
|
"shareEl": "#share",
|
2012-02-21 16:09:34 -07:00
|
|
|
"shareRedirect": "http://play.golang.org/p/"
|
2012-02-14 18:59:50 -07:00
|
|
|
});
|
2012-02-13 03:22:36 -07:00
|
|
|
}
|
|
|
|
|
2012-02-14 18:59:50 -07:00
|
|
|
google.setOnLoadCallback(init);
|
2012-02-13 03:22:36 -07:00
|
|
|
</script>
|