| OLD | NEW |
| 1 <!--{ | 1 <!--{ |
| 2 "Title": "How to Write Go Code" | 2 "Title": "How to Write Go Code" |
| 3 }--> | 3 }--> |
| 4 | 4 |
| 5 <h2 id="Introduction">Introduction</h2> | 5 <h2 id="Introduction">Introduction</h2> |
| 6 | 6 |
| 7 <p> | 7 <p> |
| 8 This document demonstrates the development of a simple Go package and | 8 This document demonstrates the development of a simple Go package and |
| 9 introduces the <a href="/cmd/go/">go tool</a>, the standard way to fetch, | 9 introduces the <a href="/cmd/go/">go tool</a>, the standard way to fetch, |
| 10 build, and install Go packages and commands. | 10 build, and install Go packages and commands. |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 $ <b>mkdir $HOME/go</b> | 118 $ <b>mkdir $HOME/go</b> |
| 119 $ <b>export GOPATH=$HOME/go</b> | 119 $ <b>export GOPATH=$HOME/go</b> |
| 120 </pre> | 120 </pre> |
| 121 | 121 |
| 122 <p> | 122 <p> |
| 123 For convenience, add the workspace's <code>bin</code> subdirectory | 123 For convenience, add the workspace's <code>bin</code> subdirectory |
| 124 to your <code>PATH</code>: | 124 to your <code>PATH</code>: |
| 125 </p> | 125 </p> |
| 126 | 126 |
| 127 <pre> | 127 <pre> |
| 128 $ <b>export PATH=$PATH:$HOME/go/bin</b> | 128 $ <b>export PATH=$PATH:$GOPATH/bin</b> |
| 129 </pre> | 129 </pre> |
| 130 | 130 |
| 131 | 131 |
| 132 <h3 id="PackagePaths">Package paths</h3> | 132 <h3 id="PackagePaths">Package paths</h3> |
| 133 | 133 |
| 134 <p> | 134 <p> |
| 135 The packages from the standard library are given short paths such as | 135 The packages from the standard library are given short paths such as |
| 136 <code>"fmt"</code> and <code>"net/http"</code>. | 136 <code>"fmt"</code> and <code>"net/http"</code>. |
| 137 For your own packages, you must choose a base path that is unlikely to | 137 For your own packages, you must choose a base path that is unlikely to |
| 138 collide with future additions to the standard library or other external | 138 collide with future additions to the standard library or other external |
| (...skipping 450 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 589 | 589 |
| 590 <p> | 590 <p> |
| 591 Take <a href="http://tour.golang.org/">A Tour of Go</a> to learn the language | 591 Take <a href="http://tour.golang.org/">A Tour of Go</a> to learn the language |
| 592 proper. | 592 proper. |
| 593 </p> | 593 </p> |
| 594 | 594 |
| 595 <p> | 595 <p> |
| 596 Visit the <a href="/doc/#articles">documentation page</a> for a set of in-depth | 596 Visit the <a href="/doc/#articles">documentation page</a> for a set of in-depth |
| 597 articles about the Go language and its libraries and tools. | 597 articles about the Go language and its libraries and tools. |
| 598 </p> | 598 </p> |
| OLD | NEW |