| 
									
										
										
										
											2012-01-20 07:37:36 +11:00
										 |  |  | <!--{
 | 
					
						
							| 
									
										
										
										
											2015-09-02 10:46:05 +10:00
										 |  |  | 	"Path": "/", | 
					
						
							|  |  |  | 	"Template": true | 
					
						
							| 
									
										
										
										
											2012-01-20 07:37:36 +11:00
										 |  |  | }--> | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-03-05 10:34:22 +11:00
										 |  |  | <div class="left"> | 
					
						
							| 
									
										
										
										
											2012-02-13 21:22:36 +11:00
										 |  |  | 
 | 
					
						
							|  |  |  | <div id="learn"> | 
					
						
							| 
									
										
										
										
											2017-08-02 16:31:46 -04:00
										 |  |  | {{if not $.GoogleCN}} | 
					
						
							| 
									
										
										
										
											2013-09-16 15:47:13 +10:00
										 |  |  | <a class="popout share">Pop-out</a> | 
					
						
							| 
									
										
										
										
											2017-08-02 16:31:46 -04:00
										 |  |  | {{end}} | 
					
						
							| 
									
										
										
										
											2012-02-13 21:22:36 +11:00
										 |  |  | <div class="rootHeading">Try Go</div> | 
					
						
							|  |  |  | <div class="input"> | 
					
						
							| 
									
										
										
										
											2012-03-13 11:00:11 +11:00
										 |  |  | <textarea spellcheck="false" class="code">// You can edit this code! | 
					
						
							| 
									
										
										
										
											2012-02-13 21:22:36 +11:00
										 |  |  | // Click here and start typing. | 
					
						
							|  |  |  | package main | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | import "fmt" | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | func main() { | 
					
						
							|  |  |  | 	fmt.Println("Hello, 世界") | 
					
						
							|  |  |  | }</textarea> | 
					
						
							|  |  |  | </div> | 
					
						
							| 
									
										
										
										
											2012-03-13 11:00:11 +11:00
										 |  |  | <div class="output"> | 
					
						
							| 
									
										
										
										
											2012-02-13 21:22:36 +11:00
										 |  |  | <pre> | 
					
						
							|  |  |  | Hello, 世界 | 
					
						
							|  |  |  | </pre> | 
					
						
							|  |  |  | </div> | 
					
						
							|  |  |  | <div class="buttons"> | 
					
						
							| 
									
										
										
										
											2012-03-15 17:44:47 +11:00
										 |  |  | <a class="run" href="#" title="Run this code [shift-enter]">Run</a> | 
					
						
							| 
									
										
										
										
											2017-08-02 16:31:46 -04:00
										 |  |  | {{if not $.GoogleCN}} | 
					
						
							| 
									
										
										
										
											2012-03-15 17:44:47 +11:00
										 |  |  | <a class="share" href="#" title="Share this code">Share</a> | 
					
						
							| 
									
										
										
										
											2014-07-25 10:28:39 +10:00
										 |  |  | <a class="tour" href="//tour.golang.org/" title="Learn Go from your browser">Tour</a> | 
					
						
							| 
									
										
										
										
											2017-08-02 16:31:46 -04:00
										 |  |  | {{end}} | 
					
						
							| 
									
										
										
										
											2012-03-15 17:44:47 +11:00
										 |  |  | </div> | 
					
						
							|  |  |  | <div class="toys"> | 
					
						
							|  |  |  | <select> | 
					
						
							|  |  |  | 	<option value="hello.go">Hello, World!</option> | 
					
						
							| 
									
										
										
										
											2013-06-04 12:59:28 +10:00
										 |  |  | 	<option value="life.go">Conway's Game of Life</option> | 
					
						
							| 
									
										
										
										
											2012-03-15 17:44:47 +11: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 21:22:36 +11:00
										 |  |  | </div> | 
					
						
							|  |  |  | </div> | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | </div> | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-03-05 10:34:22 +11:00
										 |  |  | <div class="right"> | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | <div id="about"> | 
					
						
							| 
									
										
										
										
											2013-10-29 15:56:38 +09:00
										 |  |  | Go is an open source programming language that makes it easy to build | 
					
						
							| 
									
										
										
										
											2012-03-05 10:34:22 +11:00
										 |  |  | simple, reliable, and efficient software. | 
					
						
							|  |  |  | </div> | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | <div id="gopher"></div> | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-01-19 22:47:23 -05:00
										 |  |  | <a href="/dl/" id="start"> | 
					
						
							| 
									
										
										
										
											2013-03-01 11:22:13 +11:00
										 |  |  | <span class="big">Download Go</span> | 
					
						
							|  |  |  | <span class="desc"> | 
					
						
							| 
									
										
										
										
											2012-03-05 10:34:22 +11:00
										 |  |  | Binary distributions available for<br> | 
					
						
							|  |  |  | Linux, Mac OS X, Windows, and more. | 
					
						
							| 
									
										
										
										
											2013-03-01 11:22:13 +11:00
										 |  |  | </span> | 
					
						
							| 
									
										
										
										
											2012-03-05 10:34:22 +11:00
										 |  |  | </a> | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | </div> | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-02-13 21:22:36 +11:00
										 |  |  | <div style="clear: both"></div> | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-08-02 16:31:46 -04:00
										 |  |  | {{if not $.GoogleCN}} | 
					
						
							| 
									
										
										
										
											2012-03-05 10:34:22 +11:00
										 |  |  | <div class="left"> | 
					
						
							| 
									
										
										
										
											2017-08-02 16:31:46 -04: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 21:22:36 +11:00
										 |  |  | </div> | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-08-03 12:33:26 -04:00
										 |  |  | <div class="right"> | 
					
						
							| 
									
										
										
										
											2017-08-02 16:31:46 -04: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 12:33:26 -04:00
										 |  |  | </div> | 
					
						
							|  |  |  | {{end}} | 
					
						
							| 
									
										
										
										
											2012-02-13 21:22:36 +11:00
										 |  |  | 
 | 
					
						
							|  |  |  | <div style="clear: both;"></div> | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-08-02 16:31:46 -04:00
										 |  |  | <script> | 
					
						
							|  |  |  | (function() { | 
					
						
							|  |  |  | 	'use strict'; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-08-03 12:33:26 -04: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 16:31:46 -04: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-22 11:12:44 +10:00
										 |  |  | 	} | 
					
						
							| 
									
										
										
										
											2012-02-13 21:22:36 +11:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-08-02 16:31:46 -04: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 09:23:50 -07:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-08-02 16:31:46 -04: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 21:22:36 +11:00
										 |  |  | </script> |