Skip to content

Commit

Permalink
mem: fix code style in Seek
Browse files Browse the repository at this point in the history
Signed-off-by: Yerden Zhumabekov <yerden.zhumabekov@gmail.com>
  • Loading branch information
yerden committed Sep 2, 2020
1 parent 9e9dd69 commit d2521ec
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions mem/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d2521ec

Please sign in to comment.