mem: fix code style in Seek

Signed-off-by: Yerden Zhumabekov <yerden.zhumabekov@gmail.com>
This commit is contained in:
Yerden Zhumabekov 2020-09-02 00:30:04 +06:00
parent 9e9dd69b09
commit d2521ec52d
1 changed files with 4 additions and 4 deletions

View File

@ -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