mirror of
https://github.com/golang/go.git
synced 2026-02-09 11:20:05 +00:00
We don't want to permit writing before the start of an OffsetWriter.
One of the goals of OffsetWriter is to restrict where data
can be written.
However, this rule can be violated by WriteAt() method of OffsetWriter
as the following code shows:
f, _ := os.Create("file.txt")
owr := io.NewOffsetWriter(f, 10)
owr.Write([]byte("world"))
owr.WriteAt([]byte("hello"), -10)
Change-Id: I6c7519fea68daefa641f25130cdd9803dc8aae22
GitHub-Last-Rev:
|
||
|---|---|---|
| .. | ||
| fs | ||
| ioutil | ||
| example_test.go | ||
| export_test.go | ||
| io.go | ||
| io_test.go | ||
| multi.go | ||
| multi_test.go | ||
| pipe.go | ||
| pipe_test.go | ||