ci: add golangci-lint config and fix formatting

- Add .golangci.yml with minimal linters (govet, ineffassign)
- Run gofmt -s and goimports on all files to fix formatting
- Disable fieldalignment and copylocks checks in govet
This commit is contained in:
2025-12-11 17:53:28 +01:00
parent 6b66ae5429
commit 914307ac8f
89 changed files with 1516 additions and 1618 deletions

View File

@@ -29,7 +29,7 @@ func CheckDiskSpace(path string) *DiskSpaceCheck {
// If no volume, try current directory
vol = "."
}
var freeBytesAvailable, totalNumberOfBytes, totalNumberOfFreeBytes uint64
// Call Windows API
@@ -73,7 +73,7 @@ func CheckDiskSpace(path string) *DiskSpaceCheck {
func CheckDiskSpaceForRestore(path string, archiveSize int64) *DiskSpaceCheck {
check := CheckDiskSpace(path)
requiredBytes := uint64(archiveSize) * 4 // Account for decompression
// Override status based on required space
if check.AvailableBytes < requiredBytes {
check.Critical = true
@@ -83,7 +83,7 @@ func CheckDiskSpaceForRestore(path string, archiveSize int64) *DiskSpaceCheck {
check.Warning = true
check.Sufficient = false
}
return check
}
@@ -128,4 +128,3 @@ func FormatDiskSpaceMessage(check *DiskSpaceCheck) string {
return msg
}