Skip to content

Commit

Permalink
states/statemgr: staticcheck
Browse files Browse the repository at this point in the history
  • Loading branch information
jbardin committed Dec 2, 2020
1 parent 0fb7d19 commit c2f8b06
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions states/statemgr/filesystem.go
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ func (s *Filesystem) writeState(state *states.State, meta *SnapshotMeta) error {
}
s.file.State = state.DeepCopy()

if _, err := s.stateFileOut.Seek(0, os.SEEK_SET); err != nil {
if _, err := s.stateFileOut.Seek(0, io.SeekStart); err != nil {
return err
}
if err := s.stateFileOut.Truncate(0); err != nil {
Expand Down Expand Up @@ -269,7 +269,7 @@ func (s *Filesystem) refreshState() error {
}

// we have a state file, make sure we're at the start
s.stateFileOut.Seek(0, os.SEEK_SET)
s.stateFileOut.Seek(0, io.SeekStart)
reader = s.stateFileOut
}

Expand Down
6 changes: 3 additions & 3 deletions states/statemgr/filesystem_lock_unix.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
package statemgr

import (
"io"
"log"
"os"
"syscall"
)

Expand All @@ -14,7 +14,7 @@ func (s *Filesystem) lock() error {
log.Printf("[TRACE] statemgr.Filesystem: locking %s using fcntl flock", s.path)
flock := &syscall.Flock_t{
Type: syscall.F_RDLCK | syscall.F_WRLCK,
Whence: int16(os.SEEK_SET),
Whence: int16(io.SeekStart),
Start: 0,
Len: 0,
}
Expand All @@ -27,7 +27,7 @@ func (s *Filesystem) unlock() error {
log.Printf("[TRACE] statemgr.Filesystem: unlocking %s using fcntl flock", s.path)
flock := &syscall.Flock_t{
Type: syscall.F_UNLCK,
Whence: int16(os.SEEK_SET),
Whence: int16(io.SeekStart),
Start: 0,
Len: 0,
}
Expand Down

0 comments on commit c2f8b06

Please sign in to comment.