mirror of https://github.com/spf13/afero.git
mem: fix code style in Seek
Signed-off-by: Yerden Zhumabekov <yerden.zhumabekov@gmail.com>
This commit is contained in:
parent
9e9dd69b09
commit
d2521ec52d
|
@ -225,11 +225,11 @@ func (f *File) Seek(offset int64, whence int) (int64, error) {
|
|||
return 0, ErrFileClosed
|
||||
}
|
||||
switch whence {
|
||||
case 0:
|
||||
case io.SeekStart:
|
||||
atomic.StoreInt64(&f.at, offset)
|
||||
case 1:
|
||||
atomic.AddInt64(&f.at, int64(offset))
|
||||
case 2:
|
||||
case io.SeekCurrent:
|
||||
atomic.AddInt64(&f.at, offset)
|
||||
case io.SeekEnd:
|
||||
atomic.StoreInt64(&f.at, int64(len(f.fileData.data))+offset)
|
||||
}
|
||||
return f.at, nil
|
||||
|
|
Loading…
Reference in New Issue