Skip to content

Commit

Permalink
Fix Seek distances to work with sample data file
Browse files Browse the repository at this point in the history
The text in reading-files.sh suggests creating a 9-byte file, and the current
Seek distances error out.

Fixes #564
  • Loading branch information
eliben committed Jan 21, 2025
1 parent 8621605 commit 2a6ddb9
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions examples/reading-files/reading-files.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,11 @@ func main() {

// Other methods of seeking are relative to the
// current cursor position,
_, err = f.Seek(4, io.SeekCurrent)
_, err = f.Seek(2, io.SeekCurrent)
check(err)

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

// The `io` package provides some functions that may
Expand Down
4 changes: 2 additions & 2 deletions examples/reading-files/reading-files.hash
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
754d3ce4873b6f8f1c81364bfcf5fedb17020c11
upAKv1DPNMp
db59474ee414017c3021706ceb35d5e355f967b3
SKTzfpnV0To
8 changes: 4 additions & 4 deletions public/reading-files

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 2a6ddb9

Please sign in to comment.