Andrew Gerrand | 7cb21a7 | 2012-01-19 11:24:54 +1100 | [diff] [blame] | 1 | <!--{ |
Andrew Gerrand | 8bbe5cc | 2012-01-20 07:37:36 +1100 | [diff] [blame] | 2 | "Title": "Documentation", |
| 3 | "Path": "/doc/" |
Andrew Gerrand | 7cb21a7 | 2012-01-19 11:24:54 +1100 | [diff] [blame] | 4 | }--> |
Andrew Gerrand | 1ca99c8 | 2010-05-27 16:47:42 -0700 | [diff] [blame] | 5 | |
Andrew Gerrand | d84de09 | 2012-02-13 21:22:36 +1100 | [diff] [blame] | 6 | <p> |
| 7 | The Go programming language is an open source project to make programmers more |
| 8 | productive. |
| 9 | </p> |
| 10 | |
| 11 | <p> |
| 12 | Go is expressive, concise, clean, and efficient. Its concurrency |
| 13 | mechanisms make it easy to write programs that get the most out of multicore |
| 14 | and networked machines, while its novel type system enables flexible and |
| 15 | modular program construction. Go compiles quickly to machine code yet has the |
| 16 | convenience of garbage collection and the power of run-time reflection. It's a |
| 17 | fast, statically typed, compiled language that feels like a dynamically typed, |
| 18 | interpreted language. |
| 19 | </p> |
| 20 | |
| 21 | <div id="manual-nav"></div> |
Andrew Gerrand | 6ab8d24 | 2010-09-16 14:01:02 +1000 | [diff] [blame] | 22 | |
Andrew Gerrand | f78d50c | 2012-03-05 14:31:27 +1100 | [diff] [blame] | 23 | <h2>Installing Go</h2> |
| 24 | |
| 25 | <h3><a href="/doc/install">Getting Started</a></h3> |
| 26 | <p> |
| 27 | Instructions for downloading and installing the Go compilers, tools, and |
| 28 | libraries. |
| 29 | </p> |
| 30 | |
| 31 | |
Andrew Gerrand | 6ab8d24 | 2010-09-16 14:01:02 +1000 | [diff] [blame] | 32 | <h2 id="learning">Learning Go</h2> |
| 33 | |
Andrew Gerrand | f200b72 | 2012-03-06 12:50:52 +1100 | [diff] [blame] | 34 | <img class="gopher" src="/doc/gopher/doc.png"/> |
| 35 | |
Andrew Gerrand | 43ad89d | 2014-07-25 10:28:39 +1000 | [diff] [blame] | 36 | <h3 id="go_tour"><a href="//tour.golang.org/">A Tour of Go</a></h3> |
Andrew Gerrand | f03b37b | 2011-10-05 11:12:07 -0700 | [diff] [blame] | 37 | <p> |
| 38 | An interactive introduction to Go in three sections. |
| 39 | The first section covers basic syntax and data structures; the second discusses |
| 40 | methods and interfaces; and the third introduces Go's concurrency primitives. |
| 41 | Each section concludes with a few exercises so you can practice what you've |
Andrew Gerrand | 43ad89d | 2014-07-25 10:28:39 +1000 | [diff] [blame] | 42 | learned. You can <a href="//tour.golang.org/">take the tour online</a> or |
| 43 | <a href="//code.google.com/p/go-tour/">install it locally</a>. |
Andrew Gerrand | f03b37b | 2011-10-05 11:12:07 -0700 | [diff] [blame] | 44 | </p> |
| 45 | |
Andrew Gerrand | f78d50c | 2012-03-05 14:31:27 +1100 | [diff] [blame] | 46 | <h3 id="code"><a href="code.html">How to write Go code</a></h3> |
| 47 | <p> |
Andrew Gerrand | 6f9609a | 2012-11-13 16:50:44 +0100 | [diff] [blame] | 48 | Also available as a |
Andrew Gerrand | 43ad89d | 2014-07-25 10:28:39 +1000 | [diff] [blame] | 49 | <a href="//www.youtube.com/watch?v=XCsL89YtqCs">screencast</a>, this doc |
Andrew Gerrand | 6f9609a | 2012-11-13 16:50:44 +0100 | [diff] [blame] | 50 | explains how to use the <a href="/cmd/go/">go command</a> to fetch, build, and |
| 51 | install packages, commands, and run tests. |
Andrew Gerrand | f78d50c | 2012-03-05 14:31:27 +1100 | [diff] [blame] | 52 | </p> |
| 53 | |
Andrew Gerrand | 1ca99c8 | 2010-05-27 16:47:42 -0700 | [diff] [blame] | 54 | <h3 id="effective_go"><a href="effective_go.html">Effective Go</a></h3> |
| 55 | <p> |
| 56 | A document that gives tips for writing clear, idiomatic Go code. |
Rob Pike | 7201b0c | 2012-02-28 13:35:58 +1100 | [diff] [blame] | 57 | A must read for any new Go programmer. It augments the tour and |
Peter Mundy | abb0c09 | 2010-11-29 10:10:02 +0900 | [diff] [blame] | 58 | the language specification, both of which should be read first. |
Andrew Gerrand | 1ca99c8 | 2010-05-27 16:47:42 -0700 | [diff] [blame] | 59 | </p> |
| 60 | |
Andrew Gerrand | 5dd7417 | 2013-09-16 15:47:13 +1000 | [diff] [blame] | 61 | <h3 id="faq"><a href="/doc/faq">Frequently Asked Questions (FAQ)</a></h3> |
Andrew Gerrand | 1ca99c8 | 2010-05-27 16:47:42 -0700 | [diff] [blame] | 62 | <p> |
Andrew Gerrand | d84de09 | 2012-02-13 21:22:36 +1100 | [diff] [blame] | 63 | Answers to common questions about Go. |
Andrew Gerrand | 1ca99c8 | 2010-05-27 16:47:42 -0700 | [diff] [blame] | 64 | </p> |
| 65 | |
Andrew Gerrand | 5dd7417 | 2013-09-16 15:47:13 +1000 | [diff] [blame] | 66 | <h3 id="wiki"><a href="/wiki">The Go Wiki</a></h3> |
Andrew Gerrand | 539178b | 2012-03-05 15:07:43 +1100 | [diff] [blame] | 67 | <p>A wiki maintained by the Go community.</p> |
Andrew Gerrand | d84de09 | 2012-02-13 21:22:36 +1100 | [diff] [blame] | 68 | |
Andrew Gerrand | 5dd7417 | 2013-09-16 15:47:13 +1000 | [diff] [blame] | 69 | <h4 id="learn_more">More</h4> |
Andrew Gerrand | c9836be | 2012-03-08 16:10:55 +1100 | [diff] [blame] | 70 | <p> |
Andrew Gerrand | 5dd7417 | 2013-09-16 15:47:13 +1000 | [diff] [blame] | 71 | See the <a href="/wiki/Learn">Learn</a> page at the <a href="/wiki">Wiki</a> |
| 72 | for more Go learning resources. |
Andrew Gerrand | c9836be | 2012-03-08 16:10:55 +1100 | [diff] [blame] | 73 | </p> |
| 74 | |
Andrew Gerrand | 5dd7417 | 2013-09-16 15:47:13 +1000 | [diff] [blame] | 75 | |
| 76 | <h2 id="references">References</h2> |
| 77 | |
| 78 | <h3 id="pkg"><a href="/pkg/">Package Documentation</a></h3> |
Andrew Gerrand | 3bd0769 | 2013-05-01 10:00:05 -0400 | [diff] [blame] | 79 | <p> |
Andrew Gerrand | 5dd7417 | 2013-09-16 15:47:13 +1000 | [diff] [blame] | 80 | The documentation for the Go standard library. |
Andrew Gerrand | 3bd0769 | 2013-05-01 10:00:05 -0400 | [diff] [blame] | 81 | </p> |
| 82 | |
Andrew Gerrand | 5dd7417 | 2013-09-16 15:47:13 +1000 | [diff] [blame] | 83 | <h3 id="cmd"><a href="/doc/cmd">Command Documentation</a></h3> |
Rob Pike | a97a7c5 | 2013-09-12 09:08:59 +1000 | [diff] [blame] | 84 | <p> |
Andrew Gerrand | 5dd7417 | 2013-09-16 15:47:13 +1000 | [diff] [blame] | 85 | The documentation for the Go tools. |
Rob Pike | a97a7c5 | 2013-09-12 09:08:59 +1000 | [diff] [blame] | 86 | </p> |
| 87 | |
Andrew Gerrand | 48ba6fe | 2013-10-04 09:45:06 +1000 | [diff] [blame] | 88 | <h3 id="spec"><a href="/ref/spec">Language Specification</a></h3> |
Andrew Gerrand | c9836be | 2012-03-08 16:10:55 +1100 | [diff] [blame] | 89 | <p> |
Andrew Gerrand | 5dd7417 | 2013-09-16 15:47:13 +1000 | [diff] [blame] | 90 | The official Go Language specification. |
Andrew Gerrand | c9836be | 2012-03-08 16:10:55 +1100 | [diff] [blame] | 91 | </p> |
| 92 | |
Andrew Gerrand | 48ba6fe | 2013-10-04 09:45:06 +1000 | [diff] [blame] | 93 | <h3 id="go_mem"><a href="/ref/mem">The Go Memory Model</a></h3> |
Andrew Gerrand | 5dd7417 | 2013-09-16 15:47:13 +1000 | [diff] [blame] | 94 | <p> |
| 95 | A document that specifies the conditions under which reads of a variable in |
| 96 | one goroutine can be guaranteed to observe values produced by writes to the |
| 97 | same variable in a different goroutine. |
| 98 | </p> |
| 99 | |
Andrew Gerrand | d131ffe | 2014-06-12 13:31:13 +1000 | [diff] [blame] | 100 | <h3 id="release"><a href="/doc/devel/release.html">Release History</a></h3> |
| 101 | <p>A summary of the changes between Go releases.</p> |
| 102 | |
Andrew Gerrand | 5dd7417 | 2013-09-16 15:47:13 +1000 | [diff] [blame] | 103 | |
| 104 | <h2 id="articles">Articles</h2> |
Andrew Gerrand | d84de09 | 2012-02-13 21:22:36 +1100 | [diff] [blame] | 105 | |
Andrew Gerrand | 43ad89d | 2014-07-25 10:28:39 +1000 | [diff] [blame] | 106 | <h3 id="blog"><a href="//blog.golang.org/">The Go Blog</a></h3> |
Andrew Gerrand | f78d50c | 2012-03-05 14:31:27 +1100 | [diff] [blame] | 107 | <p>The official blog of the Go project, featuring news and in-depth articles by |
| 108 | the Go team and guests.</p> |
| 109 | |
Andrew Gerrand | e8636a6 | 2012-03-13 11:00:11 +1100 | [diff] [blame] | 110 | <h4>Codewalks</h4> |
Yves Junqueira | de3a397 | 2010-11-23 10:43:16 +1100 | [diff] [blame] | 111 | <p> |
Francisco Souza | a786fe8 | 2012-03-27 13:35:40 +1100 | [diff] [blame] | 112 | Guided tours of Go programs. |
Yves Junqueira | de3a397 | 2010-11-23 10:43:16 +1100 | [diff] [blame] | 113 | </p> |
Andrew Gerrand | 3bc2d0f | 2011-09-10 09:35:25 +1000 | [diff] [blame] | 114 | <ul> |
| 115 | <li><a href="/doc/codewalk/functions">First-Class Functions in Go</a></li> |
| 116 | <li><a href="/doc/codewalk/markov">Generating arbitrary text: a Markov chain algorithm</a></li> |
| 117 | <li><a href="/doc/codewalk/sharemem">Share Memory by Communicating</a></li> |
Andrew Gerrand | f78d50c | 2012-03-05 14:31:27 +1100 | [diff] [blame] | 118 | <li><a href="/doc/articles/wiki/">Writing Web Applications</a> - building a simple web application.</li> |
Andrew Gerrand | 3bc2d0f | 2011-09-10 09:35:25 +1000 | [diff] [blame] | 119 | </ul> |
Yves Junqueira | de3a397 | 2010-11-23 10:43:16 +1100 | [diff] [blame] | 120 | |
Andrew Gerrand | e8636a6 | 2012-03-13 11:00:11 +1100 | [diff] [blame] | 121 | <h4>Language</h4> |
Andrew Gerrand | 3bc2d0f | 2011-09-10 09:35:25 +1000 | [diff] [blame] | 122 | <ul> |
Andrew Gerrand | 5dd7417 | 2013-09-16 15:47:13 +1000 | [diff] [blame] | 123 | <li><a href="/blog/json-rpc-tale-of-interfaces">JSON-RPC: a tale of interfaces</a></li> |
| 124 | <li><a href="/blog/gos-declaration-syntax">Go's Declaration Syntax</a></li> |
| 125 | <li><a href="/blog/defer-panic-and-recover">Defer, Panic, and Recover</a></li> |
| 126 | <li><a href="/blog/go-concurrency-patterns-timing-out-and">Go Concurrency Patterns: Timing out, moving on</a></li> |
| 127 | <li><a href="/blog/go-slices-usage-and-internals">Go Slices: usage and internals</a></li> |
| 128 | <li><a href="/blog/gif-decoder-exercise-in-go-interfaces">A GIF decoder: an exercise in Go interfaces</a></li> |
| 129 | <li><a href="/blog/error-handling-and-go">Error Handling and Go</a></li> |
| 130 | <li><a href="/blog/organizing-go-code">Organizing Go code</a></li> |
Andrew Gerrand | 3bc2d0f | 2011-09-10 09:35:25 +1000 | [diff] [blame] | 131 | </ul> |
| 132 | |
Andrew Gerrand | e8636a6 | 2012-03-13 11:00:11 +1100 | [diff] [blame] | 133 | <h4>Packages</h4> |
Andrew Gerrand | 3bc2d0f | 2011-09-10 09:35:25 +1000 | [diff] [blame] | 134 | <ul> |
Andrew Gerrand | 5dd7417 | 2013-09-16 15:47:13 +1000 | [diff] [blame] | 135 | <li><a href="/blog/json-and-go">JSON and Go</a> - using the <a href="/pkg/encoding/json/">json</a> package.</li> |
| 136 | <li><a href="/blog/gobs-of-data">Gobs of data</a> - the design and use of the <a href="/pkg/encoding/gob/">gob</a> package.</li> |
| 137 | <li><a href="/blog/laws-of-reflection">The Laws of Reflection</a> - the fundamentals of the <a href="/pkg/reflect/">reflect</a> package.</li> |
| 138 | <li><a href="/blog/go-image-package">The Go image package</a> - the fundamentals of the <a href="/pkg/image/">image</a> package.</li> |
| 139 | <li><a href="/blog/go-imagedraw-package">The Go image/draw package</a> - the fundamentals of the <a href="/pkg/image/draw/">image/draw</a> package.</li> |
Andrew Gerrand | 3bc2d0f | 2011-09-10 09:35:25 +1000 | [diff] [blame] | 140 | </ul> |
| 141 | |
Andrew Gerrand | e8636a6 | 2012-03-13 11:00:11 +1100 | [diff] [blame] | 142 | <h4>Tools</h4> |
Andrew Gerrand | 3bc2d0f | 2011-09-10 09:35:25 +1000 | [diff] [blame] | 143 | <ul> |
Andrew Gerrand | 73b8ccb | 2012-03-07 07:40:21 +1100 | [diff] [blame] | 144 | <li><a href="/doc/articles/go_command.html">About the Go command</a> - why we wrote it, what it is, what it's not, and how to use it.</li> |
Andrew Gerrand | 5dd7417 | 2013-09-16 15:47:13 +1000 | [diff] [blame] | 145 | <li><a href="/blog/c-go-cgo">C? Go? Cgo!</a> - linking against C code with <a href="/cmd/cgo/">cgo</a>.</li> |
Andrew Gerrand | 98155bd | 2012-03-27 11:42:01 +1100 | [diff] [blame] | 146 | <li><a href="/doc/gdb">Debugging Go Code with GDB</a></li> |
Andrew Gerrand | 5dd7417 | 2013-09-16 15:47:13 +1000 | [diff] [blame] | 147 | <li><a href="/blog/godoc-documenting-go-code">Godoc: documenting Go code</a> - writing good documentation for <a href="/cmd/godoc/">godoc</a>.</li> |
| 148 | <li><a href="/blog/profiling-go-programs">Profiling Go Programs</a></li> |
Andrew Gerrand | ae5bed0 | 2014-02-11 09:26:34 +1100 | [diff] [blame] | 149 | <li><a href="/doc/articles/race_detector.html">Data Race Detector</a> - a manual for the data race detector.</li> |
Robin Eklind | 8e902dd | 2014-07-09 14:26:37 -0700 | [diff] [blame] | 150 | <li><a href="/blog/race-detector">Introducing the Go Race Detector</a> - an introduction to the race detector.</li> |
| 151 | <li><a href="/doc/asm">A Quick Guide to Go's Assembler</a> - an introduction to the assembler used by Go.</li> |
Andrew Gerrand | 3bc2d0f | 2011-09-10 09:35:25 +1000 | [diff] [blame] | 152 | </ul> |
| 153 | |
Andrew Gerrand | 5dd7417 | 2013-09-16 15:47:13 +1000 | [diff] [blame] | 154 | <h4 id="articles_more">More</h4> |
| 155 | <p> |
| 156 | See the <a href="/wiki/Articles">Articles page</a> at the |
| 157 | <a href="/wiki">Wiki</a> for more Go articles. |
| 158 | </p> |
| 159 | |
| 160 | |
Andrew Gerrand | f78d50c | 2012-03-05 14:31:27 +1100 | [diff] [blame] | 161 | <h2 id="talks">Talks</h2> |
Andrew Gerrand | bab711b | 2010-07-30 10:36:13 +1000 | [diff] [blame] | 162 | |
Andrew Gerrand | f200b72 | 2012-03-06 12:50:52 +1100 | [diff] [blame] | 163 | <img class="gopher" src="/doc/gopher/talks.png"/> |
| 164 | |
Andrew Gerrand | 0bc952c | 2012-08-09 08:50:13 +1000 | [diff] [blame] | 165 | <h3 id="video_tour_of_go"><a href="http://research.swtch.com/gotour">A Video Tour of Go</a></h3> |
| 166 | <p> |
| 167 | Three things that make Go fast, fun, and productive: |
| 168 | interfaces, reflection, and concurrency. Builds a toy web crawler to |
| 169 | demonstrate these. |
| 170 | </p> |
| 171 | |
Andrew Gerrand | 43ad89d | 2014-07-25 10:28:39 +1000 | [diff] [blame] | 172 | <h3 id="go_code_that_grows"><a href="//vimeo.com/53221560">Code that grows with grace</a></h3> |
Andrew Gerrand | 5dd7417 | 2013-09-16 15:47:13 +1000 | [diff] [blame] | 173 | <p> |
| 174 | One of Go's key design goals is code adaptability; that it should be easy to take a simple design and build upon it in a clean and natural way. In this talk Andrew Gerrand describes a simple "chat roulette" server that matches pairs of incoming TCP connections, and then use Go's concurrency mechanisms, interfaces, and standard library to extend it with a web interface and other features. While the function of the program changes dramatically, Go's flexibility preserves the original design as it grows. |
| 175 | </p> |
| 176 | |
Andrew Gerrand | 43ad89d | 2014-07-25 10:28:39 +1000 | [diff] [blame] | 177 | <h3 id="go_concurrency_patterns"><a href="//www.youtube.com/watch?v=f6kdp27TYZs">Go Concurrency Patterns</a></h3> |
Andrew Gerrand | 4087c1b | 2012-07-22 16:35:53 -0700 | [diff] [blame] | 178 | <p> |
| 179 | Concurrency is the key to designing high performance network services. Go's concurrency primitives (goroutines and channels) provide a simple and efficient means of expressing concurrent execution. In this talk we see how tricky concurrency problems can be solved gracefully with simple Go code. |
| 180 | </p> |
| 181 | |
Andrew Gerrand | 43ad89d | 2014-07-25 10:28:39 +1000 | [diff] [blame] | 182 | <h3 id="advanced_go_concurrency_patterns"><a href="//www.youtube.com/watch?v=QDDwwePbDtw">Advanced Go Concurrency Patterns</a></h3> |
Andrew Gerrand | 4087c1b | 2012-07-22 16:35:53 -0700 | [diff] [blame] | 183 | <p> |
Andrew Gerrand | 5dd7417 | 2013-09-16 15:47:13 +1000 | [diff] [blame] | 184 | This talk expands on the <i>Go Concurrency Patterns</i> talk to dive deeper into Go's concurrency primitives. |
Andrew Gerrand | bab711b | 2010-07-30 10:36:13 +1000 | [diff] [blame] | 185 | </p> |
Andrew Gerrand | 1ca99c8 | 2010-05-27 16:47:42 -0700 | [diff] [blame] | 186 | |
Andrew Gerrand | e8636a6 | 2012-03-13 11:00:11 +1100 | [diff] [blame] | 187 | <h4 id="talks_more">More</h4> |
Andrew Gerrand | 1ca99c8 | 2010-05-27 16:47:42 -0700 | [diff] [blame] | 188 | <p> |
Andrew Gerrand | 5dd7417 | 2013-09-16 15:47:13 +1000 | [diff] [blame] | 189 | See the <a href="/talks">Go Talks site</a> and <a href="/wiki/GoTalks">wiki page</a> for more Go talks. |
Andrew Gerrand | 1ca99c8 | 2010-05-27 16:47:42 -0700 | [diff] [blame] | 190 | </p> |
| 191 | |
Andrew Gerrand | 5dd7417 | 2013-09-16 15:47:13 +1000 | [diff] [blame] | 192 | |
Andrew Gerrand | f78d50c | 2012-03-05 14:31:27 +1100 | [diff] [blame] | 193 | <h2 id="nonenglish">Non-English Documentation</h2> |
| 194 | |
Andrew Gerrand | 1748dc3 | 2010-10-14 17:25:23 +1100 | [diff] [blame] | 195 | <p> |
Andrew Gerrand | 5dd7417 | 2013-09-16 15:47:13 +1000 | [diff] [blame] | 196 | See the <a href="/wiki/NonEnglish">NonEnglish</a> page |
| 197 | at the <a href="/wiki">Wiki</a> for localized |
Andrew Gerrand | f78d50c | 2012-03-05 14:31:27 +1100 | [diff] [blame] | 198 | documentation. |
Andrew Gerrand | 1748dc3 | 2010-10-14 17:25:23 +1100 | [diff] [blame] | 199 | </p> |