From 8655f04d8e21884ab69c89eb760df2e31245af91 Mon Sep 17 00:00:00 2001 From: Andrew Gerrand Date: Tue, 16 Dec 2014 12:16:25 +1100 Subject: [PATCH] doc: propose $GOPATH as $HOME/work, not $HOME/go Related to issue #9228 Change-Id: I0819e657f6393788754d1412f9c2126a170d4cf1 Reviewed-on: https://go-review.googlesource.com/1577 Reviewed-by: Rob Pike --- doc/code.html | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/doc/code.html b/doc/code.html index a4638f9ffb..2141fb6551 100644 --- a/doc/code.html +++ b/doc/code.html @@ -108,13 +108,14 @@ when developing Go code.

To get started, create a workspace directory and set GOPATH accordingly. Your workspace can be located wherever you like, but we'll use -$HOME/go in this document. Note that this must not be the +$HOME/work in this document. Note that this must not be the same path as your Go installation. +(Another common setup is to set GOPATH=$HOME.)

-$ mkdir $HOME/go
-$ export GOPATH=$HOME/go
+$ mkdir $HOME/work
+$ export GOPATH=$HOME/work
 

@@ -218,7 +219,7 @@ This command builds the hello command, producing an executable binary. It then installs that binary to the workspace's bin directory as hello (or, under Windows, hello.exe). In our example, that will be $GOPATH/bin/hello, which is -$HOME/go/bin/hello. +$HOME/work/bin/hello.

@@ -254,7 +255,7 @@ optional: you do not need to use source control to write Go code.

 $ cd $GOPATH/src/github.com/user/hello
 $ git init
-Initialized empty Git repository in /home/user/go/src/github.com/user/hello/.git/
+Initialized empty Git repository in /home/user/work/src/github.com/user/hello/.git/
 $ git add hello.go
 $ git commit -m "initial commit"
 [master (root-commit) 0b4507d] initial commit
-- 
2.50.0