mirror of
https://github.com/golang/go
synced 2024-11-21 21:54:40 -07:00
doc: update tutorial.
Fix for new regexp library ($ isn't end of line any more). Don't assume . is in PATH. R=golang-dev, dsymonds CC=golang-dev https://golang.org/cl/5175052
This commit is contained in:
parent
bba7396fbd
commit
934c768019
@ -95,7 +95,7 @@ Here's how to compile and run our program. With <code>6g</code>, say,
|
|||||||
<pre>
|
<pre>
|
||||||
$ 6g helloworld.go # compile; object goes into helloworld.6
|
$ 6g helloworld.go # compile; object goes into helloworld.6
|
||||||
$ 6l helloworld.6 # link; output goes into 6.out
|
$ 6l helloworld.6 # link; output goes into 6.out
|
||||||
$ 6.out
|
$ ./6.out
|
||||||
Hello, world; or Καλημέρα κόσμε; or こんにちは 世界
|
Hello, world; or Καλημέρα κόσμε; or こんにちは 世界
|
||||||
$
|
$
|
||||||
</pre>
|
</pre>
|
||||||
@ -544,13 +544,12 @@ composite literal, as is done here in the <code>return</code> statement from <co
|
|||||||
<p>
|
<p>
|
||||||
We can use the factory to construct some familiar, exported variables of type <code>*File</code>:
|
We can use the factory to construct some familiar, exported variables of type <code>*File</code>:
|
||||||
<p>
|
<p>
|
||||||
<pre><!--{{code "progs/file.go" `/var/` `/^.$/`}}
|
<pre><!--{{code "progs/file.go" `/var/` `/^\)/`}}
|
||||||
-->var (
|
-->var (
|
||||||
Stdin = newFile(syscall.Stdin, "/dev/stdin")
|
Stdin = newFile(syscall.Stdin, "/dev/stdin")
|
||||||
Stdout = newFile(syscall.Stdout, "/dev/stdout")
|
Stdout = newFile(syscall.Stdout, "/dev/stdout")
|
||||||
Stderr = newFile(syscall.Stderr, "/dev/stderr")
|
Stderr = newFile(syscall.Stderr, "/dev/stderr")
|
||||||
)
|
)
|
||||||
|
|
||||||
</pre>
|
</pre>
|
||||||
<p>
|
<p>
|
||||||
The <code>newFile</code> function was not exported because it's internal. The proper,
|
The <code>newFile</code> function was not exported because it's internal. The proper,
|
||||||
|
@ -87,7 +87,7 @@ Here's how to compile and run our program. With <code>6g</code>, say,
|
|||||||
<pre>
|
<pre>
|
||||||
$ 6g helloworld.go # compile; object goes into helloworld.6
|
$ 6g helloworld.go # compile; object goes into helloworld.6
|
||||||
$ 6l helloworld.6 # link; output goes into 6.out
|
$ 6l helloworld.6 # link; output goes into 6.out
|
||||||
$ 6.out
|
$ ./6.out
|
||||||
Hello, world; or Καλημέρα κόσμε; or こんにちは 世界
|
Hello, world; or Καλημέρα κόσμε; or こんにちは 世界
|
||||||
$
|
$
|
||||||
</pre>
|
</pre>
|
||||||
@ -470,7 +470,7 @@ composite literal, as is done here in the <code>return</code> statement from <co
|
|||||||
<p>
|
<p>
|
||||||
We can use the factory to construct some familiar, exported variables of type <code>*File</code>:
|
We can use the factory to construct some familiar, exported variables of type <code>*File</code>:
|
||||||
<p>
|
<p>
|
||||||
{{code "progs/file.go" `/var/` `/^.$/`}}
|
{{code "progs/file.go" `/var/` `/^\)/`}}
|
||||||
<p>
|
<p>
|
||||||
The <code>newFile</code> function was not exported because it's internal. The proper,
|
The <code>newFile</code> function was not exported because it's internal. The proper,
|
||||||
exported factory to use is <code>OpenFile</code> (we'll explain that name in a moment):
|
exported factory to use is <code>OpenFile</code> (we'll explain that name in a moment):
|
||||||
|
Loading…
Reference in New Issue
Block a user