pkg/machine: fix various linter warnings

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
This commit is contained in:
Kir Kolyshkin
2025-03-29 19:57:36 -07:00
parent 4638d434bc
commit d9090645c3
5 changed files with 3 additions and 11 deletions

View File

@ -1,5 +1,4 @@
//go:build (amd64 && !windows) || (arm64 && !windows)
// +build amd64,!windows arm64,!windows
package define

View File

@ -162,7 +162,7 @@ func (i *initMachine) withRunPlaybook(p string) *initMachine {
return i
}
func (i *initMachine) withUserModeNetworking(r bool) *initMachine { //nolint:unused
func (i *initMachine) withUserModeNetworking(r bool) *initMachine { //nolint:unused,nolintlint
i.userModeNetworking = r
return i
}

View File

@ -130,10 +130,7 @@ func launchWinProxy(opts WinProxyOpts) (bool, string, error) {
return false, "", fmt.Errorf("could not start api proxy since expected pipe is not available: %s", machinePipe)
}
globalName := false
if PipeNameAvailable(GlobalNamedPipe, GlobalNameWait) {
globalName = true
}
globalName := PipeNameAvailable(GlobalNamedPipe, GlobalNameWait)
command, err := FindExecutablePeer(winSSHProxy)
if err != nil {

View File

@ -12,10 +12,7 @@ import (
)
func isProcessAlive(pid int) bool {
if checkProcessStatus("process", pid, nil) == nil {
return true
}
return false
return checkProcessStatus("process", pid, nil) == nil
}
func checkProcessStatus(processHint string, pid int, stderrBuf *bytes.Buffer) error {

View File

@ -24,7 +24,6 @@ const registriesConf = `unqualified-search-registries=["docker.io"]
const appendPort = `grep -q Port\ %d /etc/ssh/sshd_config || echo Port %d >> /etc/ssh/sshd_config`
//nolint:unused
const changePort = `sed -E -i 's/^Port[[:space:]]+[0-9]+/Port %d/' /etc/ssh/sshd_config`
const configServices = `ln -fs /usr/lib/systemd/system/sshd.service /etc/systemd/system/multi-user.target.wants/sshd.service