OLD | NEW |
1 <!-- Installing Go --> | 1 <!-- Installing Go --> |
2 | 2 |
3 <h2>Introduction</h2> | 3 <h2>Introduction</h2> |
4 | 4 |
5 <p>Go is an open source project, distributed under a | 5 <p>Go is an open source project, distributed under a |
6 <a href="/LICENSE">BSD-style license</a>. | 6 <a href="/LICENSE">BSD-style license</a>. |
7 This document explains how to check out the sources, | 7 This document explains how to check out the sources, |
8 build them on your own machine, and run them. | 8 build them on your own machine, and run them. |
9 </p> | 9 </p> |
10 | 10 |
11 <p> | 11 <p> |
12 There are two distinct ways to experiment with Go. | 12 There are two distinct ways to experiment with Go. |
13 This document focuses on the <code>gc</code> Go | 13 This document focuses on the <code>gc</code> Go |
14 compiler and tools (<code>6g</code>, <code>8g</code> etc.). | 14 compiler and tools (<code>6g</code>, <code>8g</code> etc.). |
15 For information on how to use <code>gccgo</code>, a more traditional | 15 For information on how to use <code>gccgo</code>, a more traditional |
16 compiler using the GCC back end, see | 16 compiler using the GCC back end, see |
17 <a href="gccgo_install.html">Setting up and using gccgo</a>. | 17 <a href="gccgo_install.html">Setting up and using gccgo</a>. |
18 </p> | 18 </p> |
19 | 19 |
20 <h2>Environment variables</h2> | 20 <h2>Environment variables</h2> |
21 | 21 |
22 <p>The Go compilation environment depends on three environment | 22 <p> |
23 variables that you should set in your <code>.bashrc</code> or equivalent, | 23 The Go compilation environment depends on three environment variables plus one o
ptional variable: |
24 plus one optional variable:</p> | 24 </p> |
25 | 25 |
26 <dl> | 26 <dl> |
27 <dt> | 27 <dt> |
28 <code>$GOROOT</code> | 28 <code>$GOROOT</code> |
29 </dt> | 29 </dt> |
30 <dd>The root of the Go tree. Typically this is <code>$HOME/go</code> | 30 <dd>The root of the Go tree. Typically this is <code>$HOME/go</code> |
31 but it can be any directory. | 31 but it can be any directory. |
32 </dd> | 32 </dd> |
33 | 33 |
34 <dt> | 34 <dt> |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 </dd> | 99 </dd> |
100 </dl> | 100 </dl> |
101 | 101 |
102 <p> | 102 <p> |
103 Note that <code>$GOARCH</code> and <code>$GOOS</code> identify the | 103 Note that <code>$GOARCH</code> and <code>$GOOS</code> identify the |
104 <em>target</em> environment, not the environment you are running on. | 104 <em>target</em> environment, not the environment you are running on. |
105 In effect, you are always cross-compiling. | 105 In effect, you are always cross-compiling. |
106 </p> | 106 </p> |
107 | 107 |
108 <p> | 108 <p> |
109 Set these variables in your <code>.bashrc</code>. For example: | 109 Set these variables in your shell profile (<code>$HOME/.bashrc</code>, |
| 110 <code>$HOME/.profile</code>, or equivalent). The settings might look· |
| 111 something like this: |
110 </p> | 112 </p> |
111 | 113 |
112 <pre> | 114 <pre> |
113 export GOROOT=$HOME/go | 115 export GOROOT=$HOME/go |
114 export GOARCH=amd64 | 116 export GOARCH=amd64 |
115 export GOOS=linux | 117 export GOOS=linux |
116 </pre> | 118 </pre> |
117 | 119 |
118 <p> | 120 <p> |
119 Double-check them by listing your environment. | 121 Double-check them by listing your environment. (You will need to launch |
| 122 a new shell or terminal window for the changes to take effect.) |
120 </p> | 123 </p> |
121 | 124 |
122 <pre> | 125 <pre> |
123 $ env | grep '^GO' | 126 $ env | grep '^GO' |
124 </pre> | 127 </pre> |
125 | 128 |
126 <h2>Ports</h2> | 129 <h2>Ports</h2> |
127 | 130 |
128 <p> | 131 <p> |
129 Go compilers support two operating systems (Linux, Mac OS X) and | 132 Go compilers support two operating systems (Linux, Mac OS X) and |
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
343 Bugs can be reported using the <a href="http://code.google.com/p/go/issues/list"
>Go issue tracker</a>. | 346 Bugs can be reported using the <a href="http://code.google.com/p/go/issues/list"
>Go issue tracker</a>. |
344 </p> | 347 </p> |
345 | 348 |
346 <p> | 349 <p> |
347 For those who wish to keep up with development, | 350 For those who wish to keep up with development, |
348 there is another mailing list, <a href="http://groups.google.com/group/golang-ch
eckins">golang-checkins</a>, | 351 there is another mailing list, <a href="http://groups.google.com/group/golang-ch
eckins">golang-checkins</a>, |
349 that receives a message summarizing each checkin to the Go repository. | 352 that receives a message summarizing each checkin to the Go repository. |
350 </p> | 353 </p> |
351 | 354 |
352 | 355 |
OLD | NEW |