Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable more golangci linters #219

Merged
merged 3 commits into from
Feb 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
linters:
enable:
- errcheck
- errorlint
- gofmt
- gosimple
- govet
- ineffassign
- misspell
- revive
- staticcheck
- stylecheck
- unused
- whitespace
4 changes: 2 additions & 2 deletions backend_qemu.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ var qemuMachines = map[Arch]qemuMachine{
binary: "qemu-system-aarch64",
console: "ttyAMA0",
machine: "virt",
/* The default cpu is a 32 bit one, which isn't very usefull
/* The default cpu is a 32 bit one, which isn't very useful
* for 64 bit arm. There is no cpu setting for "minimal" 64
* bit linux capable processor. The only generic setting
* is "max", but that can be very slow to emulate. So pick
Expand Down Expand Up @@ -174,7 +174,7 @@ func (b qemuBackend) JobOutputTTY() string {
return "/dev/hvc0"
}

func (b qemuBackend) MountParameters(mount mountPoint) (string, []string) {
func (b qemuBackend) MountParameters(_ mountPoint) (string, []string) {
return "9p", []string{"trans=virtio", "version=9p2000.L", "cache=loose", "msize=262144"}
}

Expand Down
3 changes: 1 addition & 2 deletions cmd/fakemachine/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,8 @@ func main() {
var flagsErr *flags.Error
if errors.As(err, &flagsErr) && flagsErr.Type == flags.ErrHelp {
os.Exit(0)
} else {
os.Exit(1)
}
os.Exit(1)
}

m, err := fakemachine.NewMachineWithBackend(options.Backend)
Expand Down
2 changes: 1 addition & 1 deletion decompressors_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func checkStreamsMatch(t *testing.T, output, check io.Reader) error {
i, ochar, cchar)
return errors.New("Data mismatch")
}
i += 1
i++
}
}

Expand Down
4 changes: 2 additions & 2 deletions machine.go
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ func NewMachineWithBackend(backendName string) (*Machine, error) {
m.AddVolume("/etc/ssl")
}

// Mounts for java VM configuration, especialy security policies
// Mounts for java VM configuration, especially security policies
matches, _ := filepath.Glob("/etc/java*")
for _, path := range matches {
stat, err := os.Stat(path)
Expand Down Expand Up @@ -566,7 +566,7 @@ func (m *Machine) generateModulesDep(w *writerhelper.WriterHelper, moddir string
deps[j] = deppath
}
output[i] = fmt.Sprintf("%s: %s", modpath, strings.Join(deps, " "))
i += 1
i++
}

path := path.Join(moddir, "modules.dep")
Expand Down
Loading