states/statemgr: staticcheck

This commit is contained in:
James Bardin 2020-12-01 15:56:32 -05:00
parent 0fb7d19191
commit c2f8b06594
2 changed files with 5 additions and 5 deletions

View File

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

View File

@ -3,8 +3,8 @@
package statemgr
import (
"io"
"log"
"os"
"syscall"
)
@ -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,
}
@ -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,
}