From 64d2a7c8945ba05af859901f5e248f1befdd8621 Mon Sep 17 00:00:00 2001
From: Michael Stapelberg arm
(a.k.a. ARM
); 5g,5l,5c,5a
-The compilers can target the FreeBSD, Linux, NetBSD, OpenBSD, OS X (Darwin), +The compilers can target the FreeBSD, Linux, NetBSD, OpenBSD, OS X (Darwin), Plan 9, and Windows operating systems. The full set of supported combinations is listed in the discussion of environment variables below. @@ -216,8 +216,61 @@ If you see the "hello, world" message then Go is installed correctly.
-The document How to Write Go Code explains how to -set up a work environment in which to build and test Go code. +You're almost done. +You just need to do a little more setup. +
+ ++ +How to Write Go Code +Learn how to set up and use the Go tools + +
+ ++The How to Write Go Code document +provides essential setup instructions for using the Go tools. +
+ + +
+The source code for several Go tools (including godoc)
+is kept in the go.tools repository.
+To install all of them, run the go
get
command:
+
+$ go get code.google.com/p/go.tools/cmd/... ++ +
+Or if you just want to install a specific command (godoc
in this case):
+
+$ go get code.google.com/p/go.tools/cmd/godoc ++ +
+To install these tools, the go
get
command requires
+that Mercurial be installed locally.
+
+You must also have a workspace (GOPATH
) set up;
+see How to Write Go Code for the details.
+
+Note: The go
command will install the godoc
+binary to $GOROOT/bin
(or $GOBIN
) and the
+cover
and vet
binaries to
+$GOROOT/pkg/tool/$GOOS_$GOARCH
.
+You can access the latter commands with
+"go
tool
cover
" and
+"go
tool
vet
".
- -++
$GOROOT
+
$GOROOT
The root of the Go tree, often
-$HOME/go
. Its value is built into the tree when it is compiled, and @@ -284,7 +336,7 @@ There is no need to set this unless you want to switch between multiple local copies of the repository.+
$GOROOT_FINAL
$GOROOT_FINAL
The value assumed by installed binaries and scripts when
-$GOROOT
is not set explicitly. @@ -294,7 +346,7 @@ but move it elsewhere after the build, set$GOROOT_FINAL
to the eventual location.+
$GOOS
and$GOARCH
$GOOS
and$GOARCH
The name of the target operating system and compilation architecture. These default to the values of
$GOHOSTOS
and @@ -311,7 +363,7 @@ Choices for$GOARCH
are The valid combinations of$GOOS
and$GOARCH
are:-
- $GOOS
$GOARCH
+ $GOOS
$GOARCH
darwin
@@ -326,6 +378,9 @@ The valid combinations of 386
$GOOS
and$GOARCH
are:freebsd
amd64
+ +freebsd
+ arm
linux
386
@@ -341,6 +396,9 @@ The valid combinations of $GOOS
and$GOARCH
are:netbsd
amd64
+ +netbsd
+ arm
openbsd
386
@@ -350,6 +408,9 @@ The valid combinations of $GOOS
and$GOARCH
are:plan9
386
+ +plan9
+ amd64
windows
386
@@ -357,7 +418,7 @@ The valid combinations of $GOOS
and$GOARCH
are:+
$GOHOSTOS
and$GOHOSTARCH
$GOHOSTOS
and$GOHOSTARCH
The name of the host operating system and compilation architecture. These default to the local system's operating system and @@ -372,7 +433,7 @@ For example, you should not set
-$GOHOSTARCH
toarm
on an x86 system.
$GOBIN
+$GOBIN
The location where Go binaries will be installed. The default is
-$GOROOT/bin
. @@ -382,15 +443,38 @@ If$GOBIN
is set, the go command installs all commands there.+
$GOARM
(arm, default=6)$GO386
(for386
only, default is auto-detected +if built natively,387
if not) ++This controls the code generated by 8g to use either the 387 floating-point unit +(set to
+387
) or SSE2 instructions (set tosse2
) for +floating point computations. ++
+ +GO386=387
: use x87 for floating point operations; should support all x86 chips (Pentium MMX or later). +GO386=sse2
: use SSE2 for floating point operations; has better performance than 387, but only available on Pentium 4/Opteron/Athlon 64 or later. +$GOARM
(forarm
only; default is auto-detected if building +on the target processor, 6 if not) ++This sets the ARM floating point co-processor architecture version the run-time +should target. If you are compiling on the target system, its value will be auto-detected. +
++
GOARM=5
: use software floating point; when CPU doesn't have VFP co-processor +GOARM=6
: use VFPv1 only; default if cross compiling; usually ARM11 or better cores (VFPv2 or better is also supported) +GOARM=7
: use VFPv3; usually Cortex-A cores +-The ARM architecture version the run-time libraries should target. -Setting
-$GOARM
to 5 causes the linker to emit calls -to a software floating point implementation instead of using -hardware floating point support. +If in doubt, leave this variable unset, and adjust it if required +when you first run the Go executable. +The GoARM page +on the Go community wiki +contains further details regarding Go's ARM support.
Note that $GOARCH
and $GOOS
identify the
--
cgit v1.2.3