From: Bryan C. Mills
Date: Wed, 5 Feb 2020 15:22:07 +0000 (-0500)
Subject: doc/install.html: streamline the “Test your installation” step and make it module...
X-Git-Tag: go1.14~10^2~10
X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=702226f93321a6cc9c90c657c589c869c70872fc;p=gostls13.git
doc/install.html: streamline the “Test your installation” step and make it module-agnostic
In CL 199417, we updated “How to Write Go Code” to give a basic
introduction to modules and to include module-mode commands.
However, most new users will end up reading “Getting Started”
(doc/install.html) before “How to Write Go Code”, and we forgot to
update the handful of commands there for module mode.
Before this change, the “Test your installation” section also covered
quite a few operations beoyond merely testing the installation: it
included setting up a GOPATH, building a binary, and installing and
cleaning binaries. Those are valuable operations to learn, but they
arguably belong in “How to Write Go Code”, not “Test your
installation” — and having all that extra detail in the install
instructions may well discourage folks from further essential reading.
Rather than updating all of those operations here, I've removed them.
A companion CL will update “How to Write Go Code” to ensure that it
mentions GOPATH (as the location of the module cache and the default
install location for binaries) and 'go clean -i'.
Updates #37042
Change-Id: I157f21ccbe3896575fa1115dc821abf6c71ed15e
Reviewed-on: https://go-review.googlesource.com/c/go/+/217840
Run-TryBot: Bryan C. Mills
TryBot-Result: Gobot Gobot
Reviewed-by: Ian Lance Taylor
Reviewed-by: Tyler Bui-Palsulich
---
diff --git a/doc/install.html b/doc/install.html
index 05b6d0538c..40faadb2fa 100644
--- a/doc/install.html
+++ b/doc/install.html
@@ -192,20 +192,11 @@ Settings" option inside the "System" control panel.
Test your installation
-Check that Go is installed correctly by setting up a workspace
-and building a simple program, as follows.
+Check that Go is installed correctly by building a simple program, as follows.
-Create your workspace directory,
-$HOME/go
%USERPROFILE%\go
.
-(If you'd like to use a different directory,
-you will need to set the GOPATH
environment variable.)
-
-
-
-Next, make the directory src/hello
src\hello
inside your workspace,
-and in that directory create a file named hello.go
that looks like:
+Create a file named hello.go
that looks like:
@@ -223,19 +214,17 @@ Then build it with the go
tool:
-$ cd $HOME/go/src/hello
-$ go build
+$ go build hello.go
-C:\> cd %USERPROFILE%\go\src\hello
-C:\Users\Gopher\go\src\hello> go build
+C:\Users\Gopher\go\src\hello> go build hello.go
The command above will build an executable named
hello
hello.exe
-in the directory alongside your source code.
+in the current directory alongside your source code.
Execute it to see the greeting:
@@ -253,12 +242,6 @@ hello, world
If you see the "hello, world" message then your Go installation is working.
-
-You can run go
install
to install the binary into
-your workspace's bin
directory
-or go
clean
-i
to remove it.
-
-
Before rushing off to write Go code please read the
How to Write Go Code document,