]> Cypherpunks repositories - gostls13.git/commitdiff
doc: show relevant test instructions on install page
authorAndrew Gerrand <adg@golang.org>
Wed, 6 Jan 2016 23:53:07 +0000 (10:53 +1100)
committerAndrew Gerrand <adg@golang.org>
Thu, 7 Jan 2016 01:41:19 +0000 (01:41 +0000)
Fixes golang/go#12490

Change-Id: I0861e62aaa589fc63217c83e9c227c17e35cda75
Reviewed-on: https://go-review.googlesource.com/18277
Reviewed-by: Russ Cox <rsc@golang.org>
doc/install.html

index e9f0f0dc095c5c920aab6d855196dbdda2c5d449..6baf2b53c8fba69fae8bdb83356ec4a8b4ce4913 100644 (file)
@@ -220,19 +220,29 @@ and building a simple program, as follows.
 
 <p>
 Create a directory to contain your <a href="code.html#Workspaces">workspace</a>,
-<code>$HOME/work</code> for example, and set the <code>GOPATH</code> environment
+<code class="testUnix">$HOME/work</code>
+<code class="testWindows" style="display: none">%HOME%\work</code>
+for example, and set the <code>GOPATH</code> environment
 variable to point to that location.
 </p>
 
-<pre>
+<pre class="testUnix">
 $ <b>export GOPATH=$HOME/work</b>
 </pre>
 
+<pre class="testWindows" style="display: none">
+C:\&gt; <b>set GOPATH=%HOME%\work</b>
+</pre>
+
 <p>
+<span class="testUnix">
 You should put the above command in your shell startup script
-(<code>$HOME/.profile</code> for example) or, if you use Windows,
-follow the <a href="#windows_env">instructions above</a> to set the
+(<code>$HOME/.profile</code> for example).
+</span>
+<span class="testWindows">
+On Windows, follow the <a href="#windows_env">instructions above</a> to set the
 <code>GOPATH</code> environment variable on your system.
+</span>
 </p>
 
 <p>
@@ -256,21 +266,30 @@ func main() {
 Then compile it with the <code>go</code> tool:
 </p>
 
-<pre>
+<pre class="testUnix">
 $ <b>go install github.com/user/hello</b>
 </pre>
 
+<pre class="testWindows" style="display: none">
+C:\&gt; <b>go install github.com/user/hello</b>
+</pre>
+
 <p>
-The above command will put an executable command named <code>hello</code> 
+The command above will put an executable command named <code>hello</code> 
 (or <code>hello.exe</code>) inside the <code>bin</code> directory of your workspace.
 Execute the command to see the greeting:
 </p>
 
-<pre>
+<pre class="testUnix">
 $ <b>$GOPATH/bin/hello</b>
 hello, world
 </pre>
 
+<pre class="testWindows" style="display: none">
+C:\&gt; <b>%GOPATH%\bin\hello</b>
+hello, world
+</pre>
+
 <p>
 If you see the "hello, world" message then your Go installation is working.
 </p>