1
0

Update module spf13/afero to v1.3.0 (#588)

Update module spf13/afero to v1.3.0

Reviewed-on: https://kolaente.dev/vikunja/api/pulls/588
This commit is contained in:
renovate
2020-06-17 16:52:36 +00:00
committed by konrad
parent 525a547500
commit bf41b2ed9f
21 changed files with 222 additions and 68 deletions

View File

@ -193,8 +193,11 @@ func (f *File) Read(b []byte) (n int, err error) {
}
func (f *File) ReadAt(b []byte, off int64) (n int, err error) {
prev := atomic.LoadInt64(&f.at)
atomic.StoreInt64(&f.at, off)
return f.Read(b)
n, err = f.Read(b)
atomic.StoreInt64(&f.at, prev)
return
}
func (f *File) Truncate(size int64) error {
@ -233,6 +236,9 @@ func (f *File) Seek(offset int64, whence int) (int64, error) {
}
func (f *File) Write(b []byte) (n int, err error) {
if f.closed == true {
return 0, ErrFileClosed
}
if f.readOnly {
return 0, &os.PathError{Op: "write", Path: f.fileData.name, Err: errors.New("file handle is read only")}
}