os: more descriptive error for File.ReadAt and File.WriteAt with negative offset.
The existing implementation does not provide a useful error message if a negative offset is passed in File.ReadAt or File.WriteAt. This change is to return descriptive errors. An error of type *PathError is returned to keep it consistent with rest of the code. There is no need to add an exported error variable since it's used only in one file. Fixes #19031 Change-Id: Ib94cab0afae8c5fe4dd97ed2887018a09b9f4538 Reviewed-on: https://go-review.googlesource.com/39136Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
Showing
Please
register
or
sign in
to comment