diff --git a/README.md b/README.md index 71620774..7474b4f0 100644 --- a/README.md +++ b/README.md @@ -60,7 +60,7 @@ Alternatively, `golangci-lint` can be [installed locally][lint-install] and run ### Go Generate -The pipeline checks that auto-generated code, via `go generate`, be up to date. +The pipeline checks that auto-generated code, via `go generate`, are up to date. This can be done for the entire repo: diff --git a/backup.go b/backup.go index 53fbac7e..09621c88 100644 --- a/backup.go +++ b/backup.go @@ -39,7 +39,7 @@ const ( //nolint:revive // var-naming: ALL_CAPS const ( WRITE_DAC = windows.WRITE_DAC - WRITE_OWNER = windows.WRITE_DAC + WRITE_OWNER = windows.WRITE_OWNER ACCESS_SYSTEM_SECURITY = windows.ACCESS_SYSTEM_SECURITY ) diff --git a/backup_test.go b/backup_test.go index afd26c02..112726e6 100644 --- a/backup_test.go +++ b/backup_test.go @@ -8,6 +8,8 @@ import ( "os" "syscall" "testing" + + "golang.org/x/sys/windows" ) var testFileName string @@ -200,12 +202,7 @@ func makeSparseFile() error { } defer f.Close() - const ( - fsctlSetSparse = 0x000900c4 - fsctlSetZeroData = 0x000980c8 - ) - - err = syscall.DeviceIoControl(syscall.Handle(f.Fd()), fsctlSetSparse, nil, 0, nil, 0, nil, nil) + err = syscall.DeviceIoControl(syscall.Handle(f.Fd()), windows.FSCTL_SET_SPARSE, nil, 0, nil, 0, nil, nil) if err != nil { return err }