1
0

docs.html 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211
  1. <!--{
  2. "Title": "Documentation",
  3. "Path": "/doc/"
  4. }-->
  5. <p>
  6. The Go programming language is an open source project to make programmers more
  7. productive.
  8. </p>
  9. <p>
  10. Go is expressive, concise, clean, and efficient. Its concurrency
  11. mechanisms make it easy to write programs that get the most out of multicore
  12. and networked machines, while its novel type system enables flexible and
  13. modular program construction. Go compiles quickly to machine code yet has the
  14. convenience of garbage collection and the power of run-time reflection. It's a
  15. fast, statically typed, compiled language that feels like a dynamically typed,
  16. interpreted language.
  17. </p>
  18. <div id="manual-nav"></div>
  19. <h2>Installing Go</h2>
  20. <h3><a href="/doc/install">Getting Started</a></h3>
  21. <p>
  22. Instructions for downloading and installing the Go compilers, tools, and
  23. libraries.
  24. </p>
  25. <h2 id="learning">Learning Go</h2>
  26. <img class="gopher" src="/doc/gopher/doc.png"/>
  27. <h3 id="go_tour"><a href="//tour.golang.org/">A Tour of Go</a></h3>
  28. <p>
  29. An interactive introduction to Go in three sections.
  30. The first section covers basic syntax and data structures; the second discusses
  31. methods and interfaces; and the third introduces Go's concurrency primitives.
  32. Each section concludes with a few exercises so you can practice what you've
  33. learned. You can <a href="//tour.golang.org/">take the tour online</a> or
  34. install it locally with:
  35. </p>
  36. <p>
  37. <pre>
  38. $ go get golang.org/x/tour/gotour
  39. </pre>
  40. This will place the <code>gotour</code> binary in your workspace's <code>bin</code> directory.
  41. </p>
  42. <h3 id="code"><a href="code.html">How to write Go code</a></h3>
  43. <p>
  44. Also available as a
  45. <a href="//www.youtube.com/watch?v=XCsL89YtqCs">screencast</a>, this doc
  46. explains how to use the <a href="/cmd/go/">go command</a> to fetch, build, and
  47. install packages, commands, and run tests.
  48. </p>
  49. <h3 id="editors"><a href="editors.html">Editor plugins and IDEs</a></h3>
  50. <p>
  51. A document that summarizes commonly used editor plugins and IDEs with
  52. Go support.
  53. </p>
  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.
  57. A must read for any new Go programmer. It augments the tour and
  58. the language specification, both of which should be read first.
  59. </p>
  60. <h3 id="faq"><a href="/doc/faq">Frequently Asked Questions (FAQ)</a></h3>
  61. <p>
  62. Answers to common questions about Go.
  63. </p>
  64. <h3 id="wiki"><a href="/wiki">The Go Wiki</a></h3>
  65. <p>A wiki maintained by the Go community.</p>
  66. <h4 id="learn_more">More</h4>
  67. <p>
  68. See the <a href="/wiki/Learn">Learn</a> page at the <a href="/wiki">Wiki</a>
  69. for more Go learning resources.
  70. </p>
  71. <h2 id="references">References</h2>
  72. <h3 id="pkg"><a href="/pkg/">Package Documentation</a></h3>
  73. <p>
  74. The documentation for the Go standard library.
  75. </p>
  76. <h3 id="cmd"><a href="/doc/cmd">Command Documentation</a></h3>
  77. <p>
  78. The documentation for the Go tools.
  79. </p>
  80. <h3 id="spec"><a href="/ref/spec">Language Specification</a></h3>
  81. <p>
  82. The official Go Language specification.
  83. </p>
  84. <h3 id="go_mem"><a href="/ref/mem">The Go Memory Model</a></h3>
  85. <p>
  86. A document that specifies the conditions under which reads of a variable in
  87. one goroutine can be guaranteed to observe values produced by writes to the
  88. same variable in a different goroutine.
  89. </p>
  90. <h3 id="release"><a href="/doc/devel/release.html">Release History</a></h3>
  91. <p>A summary of the changes between Go releases.</p>
  92. <h2 id="articles">Articles</h2>
  93. <h3 id="blog"><a href="//blog.golang.org/">The Go Blog</a></h3>
  94. <p>The official blog of the Go project, featuring news and in-depth articles by
  95. the Go team and guests.</p>
  96. <h4>Codewalks</h4>
  97. <p>
  98. Guided tours of Go programs.
  99. </p>
  100. <ul>
  101. <li><a href="/doc/codewalk/functions">First-Class Functions in Go</a></li>
  102. <li><a href="/doc/codewalk/markov">Generating arbitrary text: a Markov chain algorithm</a></li>
  103. <li><a href="/doc/codewalk/sharemem">Share Memory by Communicating</a></li>
  104. <li><a href="/doc/articles/wiki/">Writing Web Applications</a> - building a simple web application.</li>
  105. </ul>
  106. <h4>Language</h4>
  107. <ul>
  108. <li><a href="/blog/json-rpc-tale-of-interfaces">JSON-RPC: a tale of interfaces</a></li>
  109. <li><a href="/blog/gos-declaration-syntax">Go's Declaration Syntax</a></li>
  110. <li><a href="/blog/defer-panic-and-recover">Defer, Panic, and Recover</a></li>
  111. <li><a href="/blog/go-concurrency-patterns-timing-out-and">Go Concurrency Patterns: Timing out, moving on</a></li>
  112. <li><a href="/blog/go-slices-usage-and-internals">Go Slices: usage and internals</a></li>
  113. <li><a href="/blog/gif-decoder-exercise-in-go-interfaces">A GIF decoder: an exercise in Go interfaces</a></li>
  114. <li><a href="/blog/error-handling-and-go">Error Handling and Go</a></li>
  115. <li><a href="/blog/organizing-go-code">Organizing Go code</a></li>
  116. </ul>
  117. <h4>Packages</h4>
  118. <ul>
  119. <li><a href="/blog/json-and-go">JSON and Go</a> - using the <a href="/pkg/encoding/json/">json</a> package.</li>
  120. <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>
  121. <li><a href="/blog/laws-of-reflection">The Laws of Reflection</a> - the fundamentals of the <a href="/pkg/reflect/">reflect</a> package.</li>
  122. <li><a href="/blog/go-image-package">The Go image package</a> - the fundamentals of the <a href="/pkg/image/">image</a> package.</li>
  123. <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>
  124. </ul>
  125. <h4>Tools</h4>
  126. <ul>
  127. <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>
  128. <li><a href="/blog/c-go-cgo">C? Go? Cgo!</a> - linking against C code with <a href="/cmd/cgo/">cgo</a>.</li>
  129. <li><a href="/doc/gdb">Debugging Go Code with GDB</a></li>
  130. <li><a href="/blog/godoc-documenting-go-code">Godoc: documenting Go code</a> - writing good documentation for <a href="/cmd/godoc/">godoc</a>.</li>
  131. <li><a href="/blog/profiling-go-programs">Profiling Go Programs</a></li>
  132. <li><a href="/doc/articles/race_detector.html">Data Race Detector</a> - a manual for the data race detector.</li>
  133. <li><a href="/blog/race-detector">Introducing the Go Race Detector</a> - an introduction to the race detector.</li>
  134. <li><a href="/doc/asm">A Quick Guide to Go's Assembler</a> - an introduction to the assembler used by Go.</li>
  135. </ul>
  136. <h4 id="articles_more">More</h4>
  137. <p>
  138. See the <a href="/wiki/Articles">Articles page</a> at the
  139. <a href="/wiki">Wiki</a> for more Go articles.
  140. </p>
  141. <h2 id="talks">Talks</h2>
  142. <img class="gopher" src="/doc/gopher/talks.png"/>
  143. <h3 id="video_tour_of_go"><a href="http://research.swtch.com/gotour">A Video Tour of Go</a></h3>
  144. <p>
  145. Three things that make Go fast, fun, and productive:
  146. interfaces, reflection, and concurrency. Builds a toy web crawler to
  147. demonstrate these.
  148. </p>
  149. <h3 id="go_code_that_grows"><a href="//vimeo.com/53221560">Code that grows with grace</a></h3>
  150. <p>
  151. 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.
  152. </p>
  153. <h3 id="go_concurrency_patterns"><a href="//www.youtube.com/watch?v=f6kdp27TYZs">Go Concurrency Patterns</a></h3>
  154. <p>
  155. 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.
  156. </p>
  157. <h3 id="advanced_go_concurrency_patterns"><a href="//www.youtube.com/watch?v=QDDwwePbDtw">Advanced Go Concurrency Patterns</a></h3>
  158. <p>
  159. This talk expands on the <i>Go Concurrency Patterns</i> talk to dive deeper into Go's concurrency primitives.
  160. </p>
  161. <h4 id="talks_more">More</h4>
  162. <p>
  163. See the <a href="/talks">Go Talks site</a> and <a href="/wiki/GoTalks">wiki page</a> for more Go talks.
  164. </p>
  165. <h2 id="nonenglish">Non-English Documentation</h2>
  166. <p>
  167. See the <a href="/wiki/NonEnglish">NonEnglish</a> page
  168. at the <a href="/wiki">Wiki</a> for localized
  169. documentation.
  170. </p>