Commit b78a7b7d authored by Rob Pike's avatar Rob Pike

doc/go_tutorial: make clear the file example is Unix-specific

Fixes #2553.

R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/5472074
parent 0c5443a0
...@@ -481,8 +481,9 @@ assigned to a variable. ...@@ -481,8 +481,9 @@ assigned to a variable.
<p> <p>
<h2>An I/O Package</h2> <h2>An I/O Package</h2>
<p> <p>
Next we'll look at a simple package for doing file I/O with an Next we'll look at a simple package for doing Unix file I/O with an
open/close/read/write interface. Here's the start of <code>file.go</code>: open/close/read/write interface.
Here's the start of <code>file.go</code>:
<p> <p>
<pre><!--{{code "progs/file.go" `/package/` `/^}/`}} <pre><!--{{code "progs/file.go" `/package/` `/^}/`}}
-->package file -->package file
...@@ -507,6 +508,11 @@ and reproduce the rudiments of its file I/O. ...@@ -507,6 +508,11 @@ and reproduce the rudiments of its file I/O.
<p> <p>
The other item is the low-level, external <code>syscall</code> package, which provides The other item is the low-level, external <code>syscall</code> package, which provides
a primitive interface to the underlying operating system's calls. a primitive interface to the underlying operating system's calls.
The <code>syscall</code> package is very system-dependent, and the way it's
used here works only on Unix-like systems,
but the general ideas explored here apply broadly.
(A Windows version is available in
<a href="progs/file_windows.go"><code>file_windows.go</code></a>.)
<p> <p>
Next is a type definition: the <code>type</code> keyword introduces a type declaration, Next is a type definition: the <code>type</code> keyword introduces a type declaration,
in this case a data structure called <code>File</code>. in this case a data structure called <code>File</code>.
......
...@@ -422,8 +422,9 @@ assigned to a variable. ...@@ -422,8 +422,9 @@ assigned to a variable.
<p> <p>
<h2>An I/O Package</h2> <h2>An I/O Package</h2>
<p> <p>
Next we'll look at a simple package for doing file I/O with an Next we'll look at a simple package for doing Unix file I/O with an
open/close/read/write interface. Here's the start of <code>file.go</code>: open/close/read/write interface.
Here's the start of <code>file.go</code>:
<p> <p>
{{code "progs/file.go" `/package/` `/^}/`}} {{code "progs/file.go" `/package/` `/^}/`}}
<p> <p>
...@@ -436,6 +437,11 @@ and reproduce the rudiments of its file I/O. ...@@ -436,6 +437,11 @@ and reproduce the rudiments of its file I/O.
<p> <p>
The other item is the low-level, external <code>syscall</code> package, which provides The other item is the low-level, external <code>syscall</code> package, which provides
a primitive interface to the underlying operating system's calls. a primitive interface to the underlying operating system's calls.
The <code>syscall</code> package is very system-dependent, and the way it's
used here works only on Unix-like systems,
but the general ideas explored here apply broadly.
(A Windows version is available in
<a href="progs/file_windows.go"><code>file_windows.go</code></a>.)
<p> <p>
Next is a type definition: the <code>type</code> keyword introduces a type declaration, Next is a type definition: the <code>type</code> keyword introduces a type declaration,
in this case a data structure called <code>File</code>. in this case a data structure called <code>File</code>.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment