Skip to content

Commit 2a6ddb9

Browse files
committed
Fix Seek distances to work with sample data file
The text in reading-files.sh suggests creating a 9-byte file, and the current Seek distances error out. Fixes #564
1 parent 8621605 commit 2a6ddb9

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

examples/reading-files/reading-files.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,11 @@ func main() {
5353

5454
// Other methods of seeking are relative to the
5555
// current cursor position,
56-
_, err = f.Seek(4, io.SeekCurrent)
56+
_, err = f.Seek(2, io.SeekCurrent)
5757
check(err)
5858

5959
// and relative to the end of the file.
60-
_, err = f.Seek(-10, io.SeekEnd)
60+
_, err = f.Seek(-4, io.SeekEnd)
6161
check(err)
6262

6363
// The `io` package provides some functions that may
+2-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
754d3ce4873b6f8f1c81364bfcf5fedb17020c11
2-
upAKv1DPNMp
1+
db59474ee414017c3021706ceb35d5e355f967b3
2+
SKTzfpnV0To

public/reading-files

+4-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)