Merge pull request #17431 from oscr/use-seekstart

Use io.SeekStart instead of deprecated os.SEEK_SET
This commit is contained in:
James Bardin 2018-04-04 15:27:24 -04:00 committed by GitHub
commit 9bf9280c03
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 5 deletions

View File

@ -83,7 +83,7 @@ func (s *LocalState) WriteState(state *terraform.State) error {
s.state.Serial = s.readState.Serial
}
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 {
@ -156,7 +156,7 @@ func (s *LocalState) 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,7 +3,7 @@
package state
import (
"os"
"io"
"syscall"
)
@ -12,7 +12,7 @@ import (
func (s *LocalState) lock() error {
flock := &syscall.Flock_t{
Type: syscall.F_RDLCK | syscall.F_WRLCK,
Whence: int16(os.SEEK_SET),
Whence: int16(io.SeekStart),
Start: 0,
Len: 0,
}
@ -24,7 +24,7 @@ func (s *LocalState) lock() error {
func (s *LocalState) unlock() error {
flock := &syscall.Flock_t{
Type: syscall.F_UNLCK,
Whence: int16(os.SEEK_SET),
Whence: int16(io.SeekStart),
Start: 0,
Len: 0,
}