Skip to content

Commit 6fe41d1

Browse files
committed
go: fix lints that golangci-lint can fix
golang-ci-lint can fix some problems so let's let it fix the ones that it can. The output below lists all problems, and it only fixed some of them, but let's commit those. ``` $ golangci-lint run --max-issues-per-linter 0 --max-same-issues 0 --fix ./cmd/... ./mantle/... cmd/coreos-assembler.go:122:11: Error return value of `os.Setenv` is not checked (errcheck) os.Setenv("PYTHONUNBUFFERED", "1") ^ cmd/coreos-assembler.go:134:12: Error return value of `os.Setenv` is not checked (errcheck) os.Setenv("USER", user) ^ cmd/coreos-assembler.go:180:16: Error return value of `f.Close` is not checked (errcheck) defer f.Close() ^ mantle/auth/aliyun.go:54:15: Error return value of `f.Close` is not checked (errcheck) defer f.Close() ^ mantle/auth/azure.go:57:15: Error return value of `f.Close` is not checked (errcheck) defer f.Close() ^ mantle/auth/do.go:50:15: Error return value of `f.Close` is not checked (errcheck) defer f.Close() ^ mantle/auth/esx.go:52:15: Error return value of `f.Close` is not checked (errcheck) defer f.Close() ^ mantle/cmd/kola/devshell.go:84:20: Error return value of `os.RemoveAll` is not checked (errcheck) defer os.RemoveAll(tmpd) ^ mantle/cmd/kola/devshell.go:91:19: Error return value of `agent.Close` is not checked (errcheck) defer agent.Close() ^ mantle/cmd/kola/kola.go:292:15: Error return value of `f.Close` is not checked (errcheck) defer f.Close() ^ mantle/cmd/kola/kola.go:450:15: Error return value of `fmt.Fprintln` is not checked (errcheck) fmt.Fprintln(w, "Test Name\tPlatforms\tArchitectures\tDistributions\tTags") ^ mantle/cmd/kola/kola.go:451:15: Error return value of `fmt.Fprintln` is not checked (errcheck) fmt.Fprintln(w, "\t") ^ mantle/cmd/kola/kola.go:453:15: Error return value of `fmt.Fprintf` is not checked (errcheck) fmt.Fprintf(w, "%v\n", item) ^ mantle/cmd/kola/kola.go:455:10: Error return value of `w.Flush` is not checked (errcheck) w.Flush() ^ mantle/cmd/kola/kola.go:524:13: Error return value of `fmt.Fprintf` is not checked (errcheck) fmt.Fprintf(os.Stdout, "Serving HTTP on port: %d\n", httpPort) ^ mantle/cmd/kola/kola.go:556:15: Error return value of `os.RemoveAll` is not checked (errcheck) os.RemoveAll(qemuImageDir) ^ mantle/cmd/kola/spawn.go:154:27: Error return value of `jsonInfoFile.Close` is not checked (errcheck) defer jsonInfoFile.Close() ^ mantle/cmd/kola/spawn.go:260:17: Error return value of `f.Close` is not checked (errcheck) defer f.Close() ^ mantle/cmd/kola/testiso.go:819:20: Error return value of `os.RemoveAll` is not checked (errcheck) defer os.RemoveAll(tmpd) ^ mantle/cmd/kola/testiso.go:880:20: Error return value of `os.RemoveAll` is not checked (errcheck) defer os.RemoveAll(tmpd) ^ mantle/cmd/kola/testiso.go:951:20: Error return value of `os.RemoveAll` is not checked (errcheck) defer os.RemoveAll(tmpd) ^ mantle/cmd/kolet/kolet.go:271:22: Error return value of `systemdjournal.Print` is not checked (errcheck) systemdjournal.Print(systemdjournal.PriInfo, "Processing reboot request") ^ mantle/cmd/kolet/kolet.go:280:22: Error return value of `systemdjournal.Print` is not checked (errcheck) systemdjournal.Print(systemdjournal.PriInfo, "Acknowledged reboot request with mark: %s", buf) ^ mantle/cmd/kolet/kolet.go:300:22: Error return value of `systemdjournal.Print` is not checked (errcheck) systemdjournal.Print(systemdjournal.PriInfo, "Processing soft-reboot request") ^ mantle/cmd/kolet/kolet.go:309:22: Error return value of `systemdjournal.Print` is not checked (errcheck) systemdjournal.Print(systemdjournal.PriInfo, "Acknowledged soft-reboot request with mark: %s", buf) ^ mantle/cmd/kolet/kolet.go:348:28: Error return value of `rebootReader.Close` is not checked (errcheck) defer rebootReader.Close() ^ mantle/cmd/kolet/kolet.go:367:32: Error return value of `softRebootReader.Close` is not checked (errcheck) defer softRebootReader.Close() ^ mantle/cmd/kolet/kolet.go:409:23: Error return value of `systemdjournal.Print` is not checked (errcheck) systemdjournal.Print(systemdjournal.PriInfo, "Awaiting events") ^ mantle/cmd/kolet/kolet.go:420:26: Error return value of `systemdjournal.Print` is not checked (errcheck) systemdjournal.Print(systemdjournal.PriInfo, "Dispatching %s", n) ^ mantle/cmd/kolet/kolet.go:422:26: Error return value of `systemdjournal.Print` is not checked (errcheck) systemdjournal.Print(systemdjournal.PriInfo, "Done dispatching %s", n) ^ mantle/cmd/kolet/kolet.go:430:26: Error return value of `systemdjournal.Print` is not checked (errcheck) systemdjournal.Print(systemdjournal.PriInfo, "Unexpected event %v", n) ^ mantle/cmd/kolet/kolet.go:448:22: Error return value of `systemdjournal.Print` is not checked (errcheck) systemdjournal.Print(systemdjournal.PriInfo, "Requesting reboot with mark: %s", mark) ^ mantle/cmd/kolet/kolet.go:466:22: Error return value of `systemdjournal.Print` is not checked (errcheck) systemdjournal.Print(systemdjournal.PriInfo, "Reboot request acknowledged") ^ mantle/cmd/kolet/kolet.go:477:22: Error return value of `systemdjournal.Print` is not checked (errcheck) systemdjournal.Print(systemdjournal.PriInfo, "Requesting soft-reboot with mark: %s", mark) ^ mantle/cmd/kolet/kolet.go:495:22: Error return value of `systemdjournal.Print` is not checked (errcheck) systemdjournal.Print(systemdjournal.PriInfo, "Soft-reboot request acknowledged") ^ mantle/cmd/ore/aws/delete-image.go:67:16: Error return value of `fmt.Fprintf` is not checked (errcheck) fmt.Fprintf(os.Stdout, "No valid snapshot found for %s.\n", amiID) ^ mantle/cmd/ore/aws/upload.go:242:16: Error return value of `f.Close` is not checked (errcheck) defer f.Close() ^ mantle/cmd/ore/gcloud/upload.go:249:18: Error return value of `file.Close` is not checked (errcheck) defer file.Close() ^ mantle/cmd/ore/ibmcloud/ibmcloud.go:96:19: Error return value of `file.Close` is not checked (errcheck) defer file.Close() ^ mantle/cmd/ore/ibmcloud/upload.go:108:15: Error return value of `f.Close` is not checked (errcheck) defer f.Close() ^ mantle/cmd/plume/release.go:180:25: Error return value of `releaseFile.Close` is not checked (errcheck) defer releaseFile.Close() ^ mantle/cmd/plume/release.go:273:17: Error return value of `f.Close` is not checked (errcheck) defer f.Close() ^ mantle/fcos/metadata.go:38:16: Error return value of `res.Body.Close` is not checked (errcheck) res.Body.Close() ^ mantle/harness/harness.go:188:13: Error return value of `fmt.Fprintf` is not checked (errcheck) fmt.Fprintf(p.w, format, args...) ^ mantle/harness/harness.go:196:15: Error return value of `fmt.Fprintf` is not checked (errcheck) fmt.Fprintf(p.tap, "not ok - %s\n", name) ^ mantle/harness/harness.go:198:15: Error return value of `fmt.Fprintf` is not checked (errcheck) fmt.Fprintf(p.tap, "ok - %s # SKIP\n", name) ^ mantle/harness/harness.go:200:15: Error return value of `fmt.Fprintf` is not checked (errcheck) fmt.Fprintf(p.tap, "ok - %s\n", name) ^ mantle/harness/harness.go:600:14: Error return value of `fmt.Fprintf` is not checked (errcheck) fmt.Fprintf(root.w, "=== RUN %s\n", t.name) ^ mantle/harness/harness.go:686:9: Error return value of `f.Close` is not checked (errcheck) f.Close() ^ mantle/harness/harness_test.go:81:13: Error return value of `os.Unsetenv` is not checked (errcheck) os.Unsetenv("TERM") ^ mantle/harness/harness_test.go:458:11: Error return value of `f.Close` is not checked (errcheck) f.Close() ^ mantle/harness/harness_test.go:461:11: Error return value of `f.Close` is not checked (errcheck) f.Close() ^ mantle/harness/reporters/json.go:92:15: Error return value of `f.Close` is not checked (errcheck) defer f.Close() ^ mantle/harness/suite.go:197:10: Error return value of `f.Close` is not checked (errcheck) f.Close() ^ mantle/harness/suite.go:210:17: Error return value of `tap.Close` is not checked (errcheck) defer tap.Close() ^ mantle/harness/suite.go:252:16: Error return value of `f.Close` is not checked (errcheck) defer f.Close() ^ mantle/harness/suite.go:263:16: Error return value of `f.Close` is not checked (errcheck) defer f.Close() ^ mantle/kola/cluster/cluster.go:83:21: Error return value of `client.Close` is not checked (errcheck) defer client.Close() ^ mantle/kola/cluster/cluster.go:89:22: Error return value of `session.Close` is not checked (errcheck) defer session.Close() ^ mantle/kola/cluster/cluster.go:114:16: Error return value of `in.Close` is not checked (errcheck) defer in.Close() ^ mantle/kola/harness.go:1069:15: Error return value of `f.Close` is not checked (errcheck) defer f.Close() ^ mantle/kola/harness.go:1418:17: Error return value of `f.Close` is not checked (errcheck) defer f.Close() ^ mantle/kola/harness.go:1510:16: Error return value of `in.Close` is not checked (errcheck) defer in.Close() ^ mantle/kola/harness.go:1532:16: Error return value of `f.Close` is not checked (errcheck) defer f.Close() ^ mantle/kola/harness.go:1973:18: Error return value of `in.Close` is not checked (errcheck) defer in.Close() ^ mantle/kola/harness.go:2069:13: Error return value of `os.Remove` is not checked (errcheck) os.Remove(tempLinkPath) ^ mantle/kola/tests/coretest/helpers.go:53:15: Error return value of `f.Close` is not checked (errcheck) defer f.Close() ^ mantle/kola/tests/crio/crio.go:234:24: Error return value of `tmpFilePod.Close` is not checked (errcheck) defer tmpFilePod.Close() ^ mantle/kola/tests/crio/crio.go:245:30: Error return value of `tmpFileContainer.Close` is not checked (errcheck) defer tmpFileContainer.Close() ^ mantle/kola/tests/etcd/rhcos.go:232:21: Error return value of `client.Close` is not checked (errcheck) defer client.Close() ^ mantle/kola/tests/etcd/rhcos.go:238:22: Error return value of `session.Close` is not checked (errcheck) defer session.Close() ^ mantle/kola/tests/ignition/kdump.go:120:20: Error return value of `os.RemoveAll` is not checked (errcheck) defer os.RemoveAll(tmpd) ^ mantle/kola/tests/ignition/security.go:133:25: Error return value of `caserver.Listener.Close` is not checked (errcheck) caserver.Listener.Close() ^ mantle/kola/tests/misc/auth.go:39:15: Error return value of `client.Close` is not checked (errcheck) client.Close() ^ mantle/kola/tests/rhcos/upgrade.go:113:13: Error return value of `os.Remove` is not checked (errcheck) os.Remove(tempTar) ^ mantle/kola/tests/rhcos/upgrade.go:228:18: Error return value of `os.Remove` is not checked (errcheck) defer os.Remove(rhcosQcow2) ^ mantle/kola/tests/rhcos/upgrade.go:281:20: Error return value of `r.Body.Close` is not checked (errcheck) defer r.Body.Close() ^ mantle/kola/tests/rhcos/upgrade.go:432:17: Error return value of `os.Remove` is not checked (errcheck) defer os.Remove(rhcosQcow2GzPath) ^ mantle/lang/bufpipe/pipe_test.go:40:9: Error return value of `r.Close` is not checked (errcheck) r.Close() ^ mantle/lang/bufpipe/pipe_test.go:41:9: Error return value of `w.Close` is not checked (errcheck) w.Close() ^ mantle/lang/bufpipe/pipe_test.go:79:9: Error return value of `w.Close` is not checked (errcheck) w.Close() ^ mantle/lang/bufpipe/pipe_test.go:94:9: Error return value of `w.Close` is not checked (errcheck) w.Close() ^ mantle/lang/bufpipe/pipe_test.go:271:10: Error return value of `w.Close` is not checked (errcheck) w.Close() ^ mantle/lang/bufpipe/pipe_test.go:282:9: Error return value of `r.Close` is not checked (errcheck) r.Close() ^ mantle/lang/bufpipe/pipe_test.go:291:10: Error return value of `w.Close` is not checked (errcheck) w.Close() ^ mantle/lang/bufpipe/pipe_test.go:301:9: Error return value of `r.Close` is not checked (errcheck) r.Close() ^ mantle/lang/bufpipe/pipe_test.go:314:10: Error return value of `w.Close` is not checked (errcheck) w.Close() ^ mantle/network/bufnet/pipe_test.go:54:14: Error return value of `srv.Close` is not checked (errcheck) go srv.Close() ^ mantle/network/bufnet/pipe_test.go:56:11: Error return value of `cli.Close` is not checked (errcheck) cli.Close() ^ mantle/network/journal/record.go:78:15: Error return value of `client.Close` is not checked (errcheck) client.Close() ^ mantle/network/mockssh/mockssh_test.go:38:20: Error return value of `client.Close` is not checked (errcheck) defer client.Close() ^ mantle/network/mockssh/mockssh_test.go:56:20: Error return value of `client.Close` is not checked (errcheck) defer client.Close() ^ mantle/network/mockssh/mockssh_test.go:73:10: Error return value of `s.Close` is not checked (errcheck) s.Close() ^ mantle/network/mockssh/mockssh_test.go:75:20: Error return value of `client.Close` is not checked (errcheck) defer client.Close() ^ mantle/network/mockssh/mockssh_test.go:97:20: Error return value of `client.Close` is not checked (errcheck) defer client.Close() ^ mantle/network/mockssh/mockssh_test.go:127:20: Error return value of `client.Close` is not checked (errcheck) defer client.Close() ^ mantle/network/mockssh/mockssh_test.go:159:20: Error return value of `client.Close` is not checked (errcheck) defer client.Close() ^ mantle/network/mockssh/mockssh_test.go:181:20: Error return value of `client.Close` is not checked (errcheck) defer client.Close() ^ mantle/network/mockssh/mockssh_test.go:209:20: Error return value of `client.Close` is not checked (errcheck) defer client.Close() ^ mantle/network/ntp/server_test.go:27:15: Error return value of `s.Close` is not checked (errcheck) defer s.Close() ^ mantle/network/ssh.go:95:16: Error return value of `os.RemoveAll` is not checked (errcheck) os.RemoveAll(sockDir) ^ mantle/network/ssh.go:127:18: Error return value of `a.listener.Close` is not checked (errcheck) a.listener.Close() ^ mantle/network/ssh.go:170:15: Error return value of `client.Close` is not checked (errcheck) client.Close() ^ mantle/network/ssh_test.go:91:22: Error return value of `listener.Close` is not checked (errcheck) defer listener.Close() ^ mantle/platform/api/aws/s3.go:223:10: Error return value of `f.Close` is not checked (errcheck) f.Close() ^ mantle/platform/api/azure/api.go:60:11: Error return value of `os.Setenv` is not checked (errcheck) os.Setenv("AZURE_CLIENT_ID", azCreds.ClientID) ^ mantle/platform/api/azure/api.go:61:11: Error return value of `os.Setenv` is not checked (errcheck) os.Setenv("AZURE_TENANT_ID", azCreds.TenantID) ^ mantle/platform/api/azure/api.go:62:11: Error return value of `os.Setenv` is not checked (errcheck) os.Setenv("AZURE_CLIENT_SECRET", azCreds.ClientSecret) ^ mantle/platform/api/azure/storage.go:106:15: Error return value of `f.Close` is not checked (errcheck) defer f.Close() ^ mantle/platform/api/esx/api.go:277:15: Error return value of `f.Close` is not checked (errcheck) defer f.Close() ^ mantle/platform/api/esx/api.go:641:15: Error return value of `f.Close` is not checked (errcheck) defer f.Close() ^ mantle/platform/api/esx/archive.go:46:15: Error return value of `r.Close` is not checked (errcheck) defer r.Close() ^ mantle/platform/api/esx/archive.go:60:15: Error return value of `r.Close` is not checked (errcheck) defer r.Close() ^ mantle/platform/api/esx/archive.go:84:11: Error return value of `f.Close` is not checked (errcheck) f.Close() ^ mantle/platform/api/esx/archive.go:90:11: Error return value of `f.Close` is not checked (errcheck) f.Close() ^ mantle/platform/api/esx/archive.go:99:9: Error return value of `f.Close` is not checked (errcheck) f.Close() ^ mantle/platform/api/openstack/api.go:580:18: Error return value of `data.Close` is not checked (errcheck) defer data.Close() ^ mantle/platform/cluster.go:101:20: Error return value of `client.Close` is not checked (errcheck) defer client.Close() ^ mantle/platform/cluster.go:107:21: Error return value of `session.Close` is not checked (errcheck) defer session.Close() ^ mantle/platform/cluster.go:133:23: Error return value of `sshConfig.Close` is not checked (errcheck) defer sshConfig.Close() ^ mantle/platform/conf/conf.go:512:20: Error return value of `writer.Close` is not checked (errcheck) defer writer.Close() ^ mantle/platform/journal.go:135:15: Error return value of `f.Close` is not checked (errcheck) defer f.Close() ^ mantle/platform/local/configdrive.go:31:15: Error return value of `os.RemoveAll` is not checked (errcheck) os.RemoveAll(drivePath) ^ mantle/platform/local/configdrive.go:36:15: Error return value of `os.RemoveAll` is not checked (errcheck) os.RemoveAll(drivePath) ^ mantle/platform/local/dnsmasq.go:186:12: Error return value of `cfg.Close` is not checked (errcheck) cfg.Close() ^ mantle/platform/local/dnsmasq.go:201:12: Error return value of `cfg.Close` is not checked (errcheck) cfg.Close() ^ mantle/platform/local/dnsmasq.go:205:11: Error return value of `cfg.Close` is not checked (errcheck) cfg.Close() ^ mantle/platform/local/flight.go:50:17: Error return value of `nshandle.Close` is not checked (errcheck) nshandle.Close() ^ mantle/platform/local/tap.go:79:12: Error return value of `dev.Close` is not checked (errcheck) dev.Close() ^ mantle/platform/machine/aws/machine.go:160:15: Error return value of `f.Close` is not checked (errcheck) defer f.Close() ^ mantle/platform/machine/azure/machine.go:153:15: Error return value of `f.Close` is not checked (errcheck) defer f.Close() ^ mantle/platform/machine/esx/machine.go:121:15: Error return value of `f.Close` is not checked (errcheck) defer f.Close() ^ mantle/platform/machine/gcloud/machine.go:117:15: Error return value of `f.Close` is not checked (errcheck) defer f.Close() ^ mantle/platform/machine/openstack/machine.go:138:15: Error return value of `f.Close` is not checked (errcheck) defer f.Close() ^ mantle/platform/metal.go:235:16: Error return value of `os.RemoveAll` is not checked (errcheck) os.RemoveAll(tempdir) ^ mantle/platform/metal.go:517:17: Error return value of `out.Close` is not checked (errcheck) defer out.Close() ^ mantle/platform/metal.go:523:17: Error return value of `in.Close` is not checked (errcheck) defer in.Close() ^ mantle/platform/metal.go:649:16: Error return value of `os.RemoveAll` is not checked (errcheck) os.RemoveAll(tempdir) ^ mantle/platform/platform.go:250:21: Error return value of `srcPipe.Close` is not checked (errcheck) defer srcPipe.Close() ^ mantle/platform/platform.go:268:15: Error return value of `client.Close` is not checked (errcheck) client.Close() ^ mantle/platform/platform.go:275:16: Error return value of `session.Close` is not checked (errcheck) session.Close() ^ mantle/platform/platform.go:276:15: Error return value of `client.Close` is not checked (errcheck) client.Close() ^ mantle/platform/platform.go:287:16: Error return value of `session.Close` is not checked (errcheck) session.Close() ^ mantle/platform/platform.go:288:15: Error return value of `client.Close` is not checked (errcheck) client.Close() ^ mantle/platform/platform.go:310:20: Error return value of `client.Close` is not checked (errcheck) defer client.Close() ^ mantle/platform/platform.go:317:21: Error return value of `session.Close` is not checked (errcheck) defer session.Close() ^ mantle/platform/platform.go:342:20: Error return value of `client.Close` is not checked (errcheck) defer client.Close() ^ mantle/platform/platform.go:349:21: Error return value of `session.Close` is not checked (errcheck) defer session.Close() ^ mantle/platform/platform.go:360:20: Error return value of `stdout.Close` is not checked (errcheck) defer stdout.Close() ^ mantle/platform/qemu.go:305:25: Error return value of `inst.journalPipe.Close` is not checked (errcheck) inst.journalPipe.Close() ^ mantle/platform/qemu.go:682:10: Error return value of `l.Close` is not checked (errcheck) l.Close() ^ mantle/platform/qemu.go:913:20: Error return value of `stdout.Close` is not checked (errcheck) defer stdout.Close() ^ mantle/platform/qemu.go:1294:13: Error return value of `os.Remove` is not checked (errcheck) os.Remove(disk.dstFileName) ^ mantle/platform/qemu.go:1516:22: Error return value of `varsSrc.Close` is not checked (errcheck) defer varsSrc.Close() ^ mantle/platform/qemu.go:1638:16: Error return value of `f.Close` is not checked (errcheck) defer f.Close() ^ mantle/platform/qemu.go:2169:10: Error return value of `f.Close` is not checked (errcheck) f.Close() ^ mantle/platform/qemu.go:2174:15: Error return value of `os.RemoveAll` is not checked (errcheck) os.RemoveAll(builder.tempdir) ^ mantle/platform/util.go:57:20: Error return value of `client.Close` is not checked (errcheck) defer client.Close() ^ mantle/platform/util.go:64:21: Error return value of `session.Close` is not checked (errcheck) defer session.Close() ^ mantle/rhcos/metadata.go:40:16: Error return value of `res.Body.Close` is not checked (errcheck) res.Body.Close() ^ mantle/system/copy.go:32:21: Error return value of `srcFile.Close` is not checked (errcheck) defer srcFile.Close() ^ mantle/system/copy_test.go:30:18: Error return value of `file.Close` is not checked (errcheck) defer file.Close() ^ mantle/system/ns/enter.go:37:15: Error return value of `origns.Close` is not checked (errcheck) origns.Close() ^ mantle/system/ns/enter.go:44:21: Error return value of `origns.Close` is not checked (errcheck) defer origns.Close() ^ mantle/system/ns/enter.go:62:20: Error return value of `origns.Close` is not checked (errcheck) defer origns.Close() ^ mantle/system/ns/enter.go:70:14: Error return value of `newns.Close` is not checked (errcheck) newns.Close() ^ cmd/remote-session.go:106:10: ST1005: error strings should not be capitalized (staticcheck) return fmt.Errorf("The env var %s must be defined and non-empty", v) ^ cmd/remote-session.go:108:10: ST1005: error strings should not be capitalized (staticcheck) return fmt.Errorf("The env var %s must not be defined", v) ^ cmd/remote-session.go:234:10: ST1005: error strings should not be capitalized (staticcheck) return fmt.Errorf("Must pass in a single arg with `:` prepended") ^ mantle/cmd/kola/console.go:84:10: ST1005: error strings should not be capitalized (staticcheck) return errors.New("Errors found on console") ^ mantle/cmd/kola/devshell.go:355:14: ST1005: error strings should not be capitalized (staticcheck) return "", fmt.Errorf("Unhandled systemd json message of type %T", se.Message) ^ mantle/cmd/kola/kola.go:624:11: ST1005: error strings should not be capitalized (staticcheck) return fmt.Errorf("No QEMU in parent meta.json") ^ mantle/cmd/kola/options.go:444:10: ST1005: error strings should not be capitalized (staticcheck) return fmt.Errorf("Must specify -b/--distro with --stream") ^ mantle/cmd/kola/options.go:456:10: ST1005: error strings should not be capitalized (staticcheck) return fmt.Errorf("Unhandled stream for distribution %s", kola.Options.Distribution) ^ mantle/cmd/kola/options.go:475:10: ST1005: error strings should not be capitalized (staticcheck) return fmt.Errorf("Unhandled platform %s for stream", kolaPlatform) ^ mantle/cmd/kola/qemuexec.go:122:11: ST1005: error strings should not be capitalized (staticcheck) return fmt.Errorf("Unknown fragment: %s", fragtype) ^ mantle/cmd/kola/qemuexec.go:192:14: ST1005: error strings should not be capitalized (staticcheck) return fmt.Errorf("Multiple disk images provided") ^ mantle/cmd/kola/qemuexec.go:198:12: ST1005: error strings should not be capitalized (staticcheck) return fmt.Errorf("Unhandled non-option argument passed for qemu: %s", arg) ^ mantle/cmd/kola/qemuexec.go:214:11: ST1005: error strings should not be capitalized (staticcheck) return fmt.Errorf("Cannot use console devshell and --console-to-file") ^ mantle/cmd/kola/qemuexec.go:221:11: ST1005: error strings should not be capitalized (staticcheck) return fmt.Errorf("Cannot use devshell with --ignition-direct") ^ mantle/cmd/kola/qemuexec.go:224:11: ST1005: error strings should not be capitalized (staticcheck) return fmt.Errorf("No disk image provided") ^ mantle/cmd/kola/qemuexec.go:242:10: ST1005: error strings should not be capitalized (staticcheck) return fmt.Errorf("Cannot use both --ignition and --butane") ^ mantle/cmd/kola/qemuexec.go:245:10: ST1005: error strings should not be capitalized (staticcheck) return fmt.Errorf("Cannot use --ignition-direct without --ignition or --butane") ^ mantle/cmd/kola/qemuexec.go:248:10: ST1005: error strings should not be capitalized (staticcheck) return fmt.Errorf("Cannot use --add-ignition with --ignition-direct") ^ mantle/cmd/kola/qemuexec.go:251:10: ST1005: error strings should not be capitalized (staticcheck) return fmt.Errorf("Cannot use --bind-ro with --ignition-direct") ^ mantle/cmd/kola/qemuexec.go:254:10: ST1005: error strings should not be capitalized (staticcheck) return fmt.Errorf("Cannot use --bind-rw with --ignition-direct") ^ mantle/cmd/kola/spawn.go:94:10: ST1005: error strings should not be capitalized (staticcheck) return fmt.Errorf("Cluster Failed: nodecount must be one or more") ^ mantle/cmd/kola/spawn.go:98:10: ST1005: error strings should not be capitalized (staticcheck) return fmt.Errorf("Cannot use --reconnect on non-qemu platforms %v", kolaPlatform) ^ mantle/cmd/kola/spawn.go:152:11: ST1005: error strings should not be capitalized (staticcheck) return fmt.Errorf("Failed to create *File from fd %d", spawnJSONInfoFd) ^ mantle/cmd/kola/spawn.go:200:12: ST1005: error strings should not be capitalized (staticcheck) return fmt.Errorf("Failed writing JSON info: %v", err) ^ mantle/cmd/kola/spawn.go:258:17: ST1005: error strings should not be capitalized (staticcheck) return nil, fmt.Errorf("Couldn't connect to unix socket %q: %v", agentEnv, err) ^ mantle/cmd/kola/spawn.go:265:17: ST1005: error strings should not be capitalized (staticcheck) return nil, fmt.Errorf("Couldn't talk to ssh-agent: %v", err) ^ mantle/cmd/kola/testiso.go:506:10: ST1005: error strings should not be capitalized (staticcheck) return fmt.Errorf("Must provide --build") ^ mantle/cmd/kola/testiso.go:729:17: ST1005: error strings should not be capitalized (staticcheck) errchan <- fmt.Errorf("Got EOF from completion channel, %s expected", exp) ^ mantle/cmd/kola/testiso.go:737:16: ST1005: error strings should not be capitalized (staticcheck) errchan <- fmt.Errorf("Unexpected string from completion channel: %s expected: %s", line, exp) ^ mantle/cmd/kolet/kolet.go:224:17: ST1005: error strings should not be capitalized (staticcheck) return false, fmt.Errorf("Unit %s exited with code %d", unitname, props["ExecMainStatus"]) ^ mantle/cmd/kolet/kolet.go:249:21: ST1005: error strings should not be capitalized (staticcheck) return false, fmt.Errorf("Unit %s failed with code %d", unitname, mainstatus) ^ mantle/cmd/kolet/kolet.go:252:19: ST1005: error strings should not be capitalized (staticcheck) return true, fmt.Errorf("Unit %s killed by signal %d", unitname, mainstatus) ^ mantle/cmd/kolet/kolet.go:254:20: ST1005: error strings should not be capitalized (staticcheck) return false, fmt.Errorf("Unit %s had unhandled code %d", unitname, maincode) ^ mantle/cmd/kolet/kolet.go:259:18: ST1005: error strings should not be capitalized (staticcheck) return true, fmt.Errorf("Unit %s in substate 'failed'", unitname) ^ mantle/cmd/kolet/kolet.go:266:17: ST1005: error strings should not be capitalized (staticcheck) return false, fmt.Errorf("Unhandled systemd unit state:%s", state) ^ mantle/cmd/ore/aliyun/visibility.go:50:10: ST1005: error strings should not end with punctuation or newlines (staticcheck) return fmt.Errorf("Specify one ore more region:image pairs.\n") ^ mantle/cmd/ore/aliyun/visibility.go:54:10: ST1005: error strings should not end with punctuation or newlines (staticcheck) return fmt.Errorf("Must only specify --public or --private.\n") ^ mantle/cmd/ore/aliyun/visibility.go:59:10: ST1005: error strings should not end with punctuation or newlines (staticcheck) return fmt.Errorf("could not list regions: %v\n", err) ^ mantle/cmd/ore/aliyun/visibility.go:68:11: ST1005: error strings should not end with punctuation or newlines (staticcheck) return fmt.Errorf("Argument isn't a valid region:image pair: %v\n", pair) ^ mantle/cmd/ore/aliyun/visibility.go:73:11: ST1005: error strings should not end with punctuation or newlines (staticcheck) return fmt.Errorf("Argument isn't a valid region:image pair: %v\n", pair) ^ mantle/cmd/ore/aliyun/visibility.go:79:11: ST1005: error strings should not end with punctuation or newlines (staticcheck) return fmt.Errorf("%v is not a valid region\n", region) ^ mantle/cmd/ore/aliyun/visibility.go:89:11: ST1005: error strings should not be capitalized (staticcheck) return fmt.Errorf("Couldn't change the visibility of image %v in region %v: %v", image, region, err) ^ mantle/cmd/ore/aws/upload.go:118:15: ST1005: error strings should not end with punctuation or newlines (staticcheck) return nil, fmt.Errorf("URL missing bucket name %v\n", urlPrefix) ^ mantle/cmd/ore/azure/delete-gallery-image.go:51:10: ST1005: error strings should not end with punctuation or newlines (staticcheck) return fmt.Errorf("setting up clients: %v\n", err) ^ mantle/cmd/ore/azure/delete-gallery-image.go:57:11: ST1005: error strings should not end with punctuation or newlines (staticcheck) return fmt.Errorf("Couldn't delete gallery: %v\n", err) ^ mantle/cmd/ore/azure/delete-gallery-image.go:65:10: ST1005: error strings should not end with punctuation or newlines (staticcheck) return fmt.Errorf("Couldn't delete gallery image: %v\n", err) ^ mantle/cmd/ore/azure/delete-gallery-image.go:72:10: ST1005: error strings should not end with punctuation or newlines (staticcheck) return fmt.Errorf("Couldn't delete image: %v\n", err) ^ mantle/cmd/ore/do/create-image.go:68:10: ST1005: error strings should not be capitalized (staticcheck) return fmt.Errorf("Image name must be specified") ^ mantle/cmd/ore/do/create-image.go:71:10: ST1005: error strings should not be capitalized (staticcheck) return fmt.Errorf("Image URL must be specified") ^ mantle/cmd/ore/do/create-image.go:138:10: ST1005: error strings should not be capitalized (staticcheck) return fmt.Errorf("Failed waiting for droplet to power off (%v). Did install fail?", err) ^ mantle/cmd/ore/do/create-image.go:210:14: ST1005: error strings should not be capitalized (staticcheck) return "", fmt.Errorf("Couldn't render userdata: %v", err) ^ mantle/cmd/ore/do/delete-image.go:57:10: ST1005: error strings should not be capitalized (staticcheck) return fmt.Errorf("Image name must be specified") ^ mantle/cmd/plume/cosa2stream.go:110:12: ST1005: error strings should not be capitalized (staticcheck) return errors.New("Arguments must be https:// URLs (or with --distro rhcos, ARCH=VERSION)") ^ mantle/cmd/plume/cosa2stream.go:114:12: ST1005: error strings should not be capitalized (staticcheck) return fmt.Errorf("Expecting ARCH=VERSION, found: %s", arg) ^ mantle/cmd/plume/cosa2stream.go:155:13: ST1005: error strings should not be capitalized (staticcheck) return fmt.Errorf("Duplicate architecture %s", arch) ^ mantle/cmd/plume/cosa2stream.go:176:10: ST1005: error strings should not be capitalized (staticcheck) return fmt.Errorf("Error while encoding: %v", err) ^ mantle/cmd/plume/stream_mirror.go:82:10: ST1005: error strings should not be capitalized (staticcheck) return fmt.Errorf("Unexpected downloaded path: %s vs %s", path, destfile) ^ mantle/cmd/plume/stream_mirror.go:130:10: ST1005: error strings should not be capitalized (staticcheck) return fmt.Errorf("Must specify --dest-file with --url") ^ mantle/kola/harness.go:1988:9: ST1005: error strings should not be capitalized (staticcheck) return fmt.Errorf("Unable to locate kolet binary for %s", mArch) ^ mantle/kola/tests/coretest/core.go:184:10: ST1005: error strings should not end with punctuation or newlines (staticcheck) return fmt.Errorf("We were able to call RestartUnit as a non-root user.") ^ mantle/kola/tests/coretest/core.go:198:10: ST1005: error strings should not be capitalized (staticcheck) return fmt.Errorf("Err:%s\n Out:%v", err, out) ^ mantle/kola/tests/coretest/core.go:215:11: ST1005: error strings should not be capitalized (staticcheck) return fmt.Errorf("Services Active: %v", err) ^ mantle/kola/tests/coretest/core.go:239:11: ST1005: error strings should not be capitalized (staticcheck) return fmt.Errorf("Service Incorrectly Active: %q", unit) ^ mantle/kola/tests/coretest/core.go:255:12: ST1005: error strings should not be capitalized (staticcheck) return fmt.Errorf("Service Incorrectly Enabled: %q", unit) ^ mantle/kola/tests/coretest/core.go:275:11: ST1005: error strings should not end with punctuation or newlines (staticcheck) return fmt.Errorf("/usr is not mounted read-only.") ^ mantle/kola/tests/coretest/core.go:281:11: ST1005: error strings should not end with punctuation or newlines (staticcheck) return fmt.Errorf("/ is not mounted read-only.") ^ mantle/kola/tests/coretest/core.go:284:9: ST1005: error strings should not end with punctuation or newlines (staticcheck) return fmt.Errorf("could not find /usr or / mount points.") ^ mantle/kola/tests/coretest/core.go:387:10: ST1005: error strings should not be capitalized (staticcheck) return fmt.Errorf("Error getting journalclt output for %s: %s. Out: %s", unit, err, out) ^ mantle/kola/tests/coretest/core.go:399:10: ST1005: error strings should not be capitalized (staticcheck) return fmt.Errorf("Error getting filesystem size: %s", err) ^ mantle/kola/tests/coretest/core.go:403:10: ST1005: error strings should not be capitalized (staticcheck) return fmt.Errorf("Error converting filesystem size from string to int: %s", err) ^ mantle/kola/tests/coretest/core.go:406:10: ST1005: error strings should not be capitalized (staticcheck) return fmt.Errorf("Filesystem size is less than %d bytes, size in bytes: %d", size, filesystemSize) ^ mantle/kola/tests/ignition/kdump.go:59:11: ST1005: error strings should not end with punctuation or newlines (staticcheck) return fmt.Errorf("Kdump.service is not ready: %s.", string(kdump_status)) ^ mantle/kola/tests/ignition/kdump.go:84:11: ST1005: error strings should not be capitalized (staticcheck) return fmt.Errorf("No vmcore created on remote host") ^ mantle/kola/tests/ignition/kdump.go:351:11: ST1005: error strings should not end with punctuation or newlines (staticcheck) return fmt.Errorf("nfs.service is not ready: %s.", string(nfs_status)) ^ mantle/kola/tests/misc/multipath.go:236:18: ST1005: error strings should not end with punctuation or newlines (staticcheck) return false, fmt.Errorf("first-boot-complete.target state: %s.", string(firstbootTargetState)) ^ mantle/kola/tests/misc/network.go:152:10: ST1005: error strings should not be capitalized (staticcheck) return fmt.Errorf("Unexpected listener process: %q", line) ^ mantle/kola/tests/misc/nfs-client.go:120:11: ST1005: error strings should not end with punctuation or newlines (staticcheck) return fmt.Errorf("nfs.service is not ready: %s.", string(nfs_status)) ^ mantle/kola/tests/misc/selinux.go:95:21: ST1005: error strings should not be capitalized (staticcheck) return boolState, fmt.Errorf(`Could not get SELinux boolean: %v`, err) ^ mantle/kola/tests/ostree/sync.go:129:11: ST1005: error strings should not end with punctuation or newlines (staticcheck) return fmt.Errorf("nfs-server.service is not ready: %s.", string(nfs_status)) ^ mantle/kola/tests/ostree/unlock.go:75:10: ST1005: error strings should not be capitalized (staticcheck) return fmt.Errorf(`Hotfix mode is not reflected in "rpm-ostree status"; got: %q`, status.Deployments[0].Unlocked) ^ mantle/kola/tests/ostree/unlock.go:79:10: ST1005: error strings should not be capitalized (staticcheck) return fmt.Errorf(`Unlocked mode is not reflected in "rpm-ostree status"; got: %q`, status.Deployments[0].Unlocked) ^ mantle/kola/tests/ostree/unlock.go:91:10: ST1005: error strings should not be capitalized (staticcheck) return fmt.Errorf(`Failed to install RPM: %v`, installErr) ^ mantle/kola/tests/ostree/unlock.go:96:10: ST1005: error strings should not be capitalized (staticcheck) return fmt.Errorf(`Failed to find binary: %v`, cmdErr) ^ mantle/kola/tests/ostree/unlock.go:101:10: ST1005: error strings should not be capitalized (staticcheck) return fmt.Errorf(`Failed to find RPM in rpmdb: %v`, rpmErr) ^ mantle/kola/tests/ostree/unlock.go:113:10: ST1005: error strings should not be capitalized (staticcheck) return fmt.Errorf(`Failed to uninstall RPM: %v`, uninstallErr) ^ mantle/kola/tests/ostree/unlock.go:118:10: ST1005: error strings should not be capitalized (staticcheck) return fmt.Errorf(`Found a binary that should not be there: %v`, missCmdErr) ^ mantle/kola/tests/podman/podman.go:112:18: ST1005: error strings should not be capitalized (staticcheck) return target, fmt.Errorf("Could not get info: %v", err) ^ mantle/kola/tests/podman/podman.go:117:18: ST1005: error strings should not be capitalized (staticcheck) return target, fmt.Errorf("Could not unmarshal info %q into known JSON: %v", string(pInfoJSON), err) ^ mantle/kola/tests/podman/podman.go:152:12: ST1005: error strings should not be capitalized (staticcheck) return fmt.Errorf("Fedora container is not running %s", b) ^ mantle/kola/tests/rhcos/upgrade.go:375:14: ST1005: error strings should not be capitalized (staticcheck) return "", errors.New("Could not find the latest release") ^ mantle/kola/tests/rpmostree/status.go:51:10: ST1005: error strings should not be capitalized (staticcheck) return fmt.Errorf(`Failed to get status JSON: %v`, err) ^ mantle/kola/tests/rpmostree/status.go:55:10: ST1005: error strings should not be capitalized (staticcheck) return fmt.Errorf(`Cleanup left more than one deployment`) ^ mantle/kola/tests/util/rpmostree.go:78:14: ST1005: error strings should not be capitalized (staticcheck) return nil, errors.New("No booted deployment found") ^ mantle/network/ntp/protocol.go:212:15: ST1005: error strings should not be capitalized (staticcheck) return nil, fmt.Errorf("Invalid NTP Header %v", h) ^ mantle/platform/api/aws/ec2.go:395:15: ST1005: error strings should not end with punctuation or newlines (staticcheck) return nil, fmt.Errorf("no availability zones found for this instance type %v:", instanceType) ^ mantle/platform/api/azure/gallery.go:184:13: ST1005: error strings should not end with punctuation or newlines (staticcheck) return fmt.Errorf("Couldn't delete gallery image: %v\n", err) ^ mantle/platform/api/esx/api.go:193:15: ST1005: error strings should not end with punctuation or newlines (staticcheck) return nil, fmt.Errorf("No network device found.") ^ mantle/platform/api/esx/api.go:318:15: ST1005: error strings should not be capitalized (staticcheck) return nil, fmt.Errorf("Base VM Name must be supplied") ^ mantle/platform/api/gcloud/compute.go:162:16: ST1005: error strings should not end with punctuation or newlines (staticcheck) return nil, fmt.Errorf("Does not support confidential type %s, should be: sev, sev_snp, tdx\n", a.options.ConfidentialType) ^ mantle/platform/api/gcloud/compute.go:195:15: ST1005: error strings should not end with punctuation or newlines (staticcheck) return nil, fmt.Errorf("failed to request new GCP instance: %v\n", err) ^ mantle/platform/api/gcloud/image.go:83:22: ST1005: error strings should not be capitalized (staticcheck) return nil, nil, fmt.Errorf("Invalid GCP license %s: %v", l, err) ^ mantle/platform/api/gcloud/image.go:190:15: ST1005: error strings should not be capitalized (staticcheck) return nil, fmt.Errorf("Listing GCP images failed: %v", err) ^ mantle/platform/api/gcloud/image.go:200:15: ST1005: error strings should not be capitalized (staticcheck) return nil, fmt.Errorf("Couldn't list pending operations on %q: %v", image.Name, err) ^ mantle/platform/api/gcloud/image.go:203:15: ST1005: error strings should not be capitalized (staticcheck) return nil, fmt.Errorf("Found %d != 1 insert operations on %q", len(pendingOps.Items), image.Name) ^ mantle/platform/api/gcloud/image.go:226:15: ST1005: error strings should not be capitalized (staticcheck) return nil, fmt.Errorf("Deprecating %s failed: %v", name, err) ^ mantle/platform/api/gcloud/image.go:254:15: ST1005: error strings should not be capitalized (staticcheck) return nil, fmt.Errorf("Updating %s failed: %v", name, err) ^ mantle/platform/api/gcloud/image.go:272:10: ST1005: error strings should not be capitalized (staticcheck) return fmt.Errorf("Getting image %s IAM policy failed: %v", name, err) ^ mantle/platform/api/gcloud/image.go:286:10: ST1005: error strings should not be capitalized (staticcheck) return fmt.Errorf("Setting image %s IAM policy failed: %v", name, err) ^ mantle/platform/api/gcloud/pending.go:64:12: ST1005: error strings should not be capitalized (staticcheck) return fmt.Errorf("Fetching %q status failed: %v", p.desc, err) ^ mantle/platform/api/gcloud/pending.go:78:11: ST1005: error strings should not be capitalized (staticcheck) return fmt.Errorf("Operation %q failed: %+v", p.desc, messages) ^ mantle/platform/api/gcloud/pending.go:80:10: ST1005: error strings should not be capitalized (staticcheck) return fmt.Errorf("Operation %q failed to start", p.desc) ^ mantle/platform/api/gcloud/pending.go:89:9: ST1005: error strings should not be capitalized (staticcheck) err = fmt.Errorf("Operation %q is %q", desc, op.Status) ^ mantle/platform/api/gcloud/pending.go:93:9: ST1005: error strings should not be capitalized (staticcheck) err = fmt.Errorf("Unknown operation status %q for %q: %+v", op.Status, desc, op) ^ mantle/platform/api/gcloud/pending.go:97:10: ST1005: error strings should not be capitalized (staticcheck) return fmt.Errorf("Failed to wait for operation %q: %v", desc, err) ^ mantle/platform/api/ibmcloud/s3.go:115:10: ST1005: error strings should not be capitalized (staticcheck) return fmt.Errorf("Unable to create bucket %q, %v", bucketName, err) ^ mantle/platform/api/ibmcloud/s3.go:179:10: ST1005: error strings should not be capitalized (staticcheck) return fmt.Errorf("Error copying object to bucket: %v", err) ^ mantle/platform/api/ibmcloud/s3.go:185:10: ST1005: error strings should not be capitalized (staticcheck) return fmt.Errorf("Error occurred while waiting for item %q to be copied to bucket %q, %v", srcName, destBucket, err) ^ mantle/platform/api/openstack/api.go:557:14: ST1005: error strings should not be capitalized (staticcheck) return "", fmt.Errorf("Invalid given image visibility: %v", visibility) ^ mantle/platform/api/openstack/api.go:609:12: ST1005: error strings should not be capitalized (staticcheck) return fmt.Errorf( ^ mantle/platform/api/openstack/api.go:613:11: ST1005: error strings should not be capitalized (staticcheck) return fmt.Errorf( ^ mantle/platform/local/dnsmasq.go:158:16: ST1005: error strings should not be capitalized (staticcheck) return nil, fmt.Errorf("Network setup failed: %v", err) ^ mantle/platform/local/dnsmasq.go:166:15: ST1005: error strings should not be capitalized (staticcheck) return nil, fmt.Errorf("Network loopback setup failed: %v", err) ^ mantle/platform/local/dnsmasq.go:170:15: ST1005: error strings should not be capitalized (staticcheck) return nil, fmt.Errorf("Network loopback setup failed: %v", err) ^ mantle/platform/machine/azure/machine.go:86:10: ST1005: error strings should not be capitalized (staticcheck) return fmt.Errorf("Fetching IP addresses: %v", err) ^ mantle/platform/machine/openstack/machine.go:130:10: ST1005: error strings should not be capitalized (staticcheck) return fmt.Errorf("Error retrieving console log for %v: %v", om.ID(), err) ^ mantle/platform/metal.go:107:11: ST1005: error strings should not be capitalized (staticcheck) return fmt.Errorf("Missing artifact %s for %s build: %s", name, version, err) ^ mantle/platform/metal.go:112:12: ST1005: error strings should not be capitalized (staticcheck) return fmt.Errorf("Missing local file for artifact %s for build %s", name, version) ^ mantle/platform/metal.go:315:15: ST1005: error strings should not be capitalized (staticcheck) return nil, fmt.Errorf("Unsupported arch %s", coreosarch.CurrentRpmArch()) ^ mantle/platform/metal.go:493:21: ST1005: error strings should not be capitalized (staticcheck) *booterrchan <- fmt.Errorf("Got EOF from boot started channel, %s expected", bootStartedSignal) ^ mantle/platform/metal.go:618:15: ST1005: error strings should not be capitalized (staticcheck) return nil, fmt.Errorf("Cannot use `--add-nm-keyfile` with offline mode") ^ mantle/platform/qemu.go:358:4: SA4011: ineffective break statement. Did you mean to break out of the outer loop? (staticcheck) break ^ mantle/platform/qemu.go:376:4: SA4011: ineffective break statement. Did you mean to break out of the outer loop? (staticcheck) break ^ mantle/platform/qemu.go:381:10: ST1005: error strings should not end with punctuation or newlines (staticcheck) return fmt.Errorf("Could not find boot device using QMP.\n"+ ^ mantle/platform/qemu.go:388:10: ST1005: error strings should not end with punctuation or newlines (staticcheck) return fmt.Errorf("Could not find target disk using QMP.\n"+ ^ mantle/platform/qemu.go:465:10: ST1005: error strings should not be capitalized (staticcheck) return fmt.Errorf("Target device %q not found in block device list", device) ^ mantle/platform/qemu.go:767:10: ST1005: error strings should not be capitalized (staticcheck) return fmt.Errorf("Secure Execution was requested but isn't supported/enabled") ^ mantle/platform/qemu.go:770:10: ST1005: error strings should not be capitalized (staticcheck) return fmt.Errorf("Secure Execution was requested, but we don't have a GPG Public Key to encrypt the config") ^ mantle/platform/qemu.go:875:14: ST1005: error strings should not be capitalized (staticcheck) return "", fmt.Errorf("The pid cannot be empty") ^ mantle/platform/qemu.go:878:14: ST1005: error strings should not be capitalized (staticcheck) return "", fmt.Errorf("The label cannot be empty") ^ mantle/platform/qemu.go:928:15: ST1005: error strings should not be capitalized (staticcheck) return nil, fmt.Errorf("Failing parsing GUESTFISH_PID got: expecting length 2 got instead %d", len(gfVarPid)) ^ mantle/platform/qemu.go:932:15: ST1005: error strings should not be capitalized (staticcheck) return nil, fmt.Errorf("Failing parsing GUESTFISH_PID got: expecting length 2 got instead %d", len(gfVarPid)) ^ mantle/platform/qemu.go:1007:11: ST1005: error strings should not be capitalized (staticcheck) return fmt.Errorf("Multiple values for bootloader config: %v", confpathout) ^ mantle/platform/qemu.go:2142:6: SA4011: ineffective break statement. Did you mean to break out of the outer loop? (staticcheck) break ^ mantle/system/copy.go:40:10: ST1005: error strings should not be capitalized (staticcheck) return fmt.Errorf("Not a regular file: %s", src) ^ mantle/util/distros.go:46:14: ST1005: error strings should not be capitalized (staticcheck) return "", fmt.Errorf("Unknown distribution: %s", build.Name) ^ 311 issues: * errcheck: 166 * staticcheck: 145 ```
1 parent 929898b commit 6fe41d1

34 files changed

Lines changed: 80 additions & 73 deletions

File tree

mantle/cmd/kola/devshell.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ func runDevShellSSH(ctx context.Context, builder *platform.QemuBuilder, conf *co
155155
errChan <- err
156156
}
157157

158-
_, _ = serialLog.WriteString(fmt.Sprintf("%s\n", msg))
158+
_, _ = fmt.Fprintf(serialLog, "%s\n", msg)
159159
serialChan <- msg
160160
checkWriteState(msg, stateChan)
161161
}

mantle/cmd/ore/gcloud/upload.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -220,11 +220,11 @@ func gcpSanitize(name string) string {
220220
}
221221

222222
// remove incompatible chars from version.txt
223-
name = strings.Replace(name, ".", "-", -1)
224-
name = strings.Replace(name, "+", "-", -1)
223+
name = strings.ReplaceAll(name, ".", "-")
224+
name = strings.ReplaceAll(name, "+", "-")
225225

226226
// remove forward slashes likely from prefix
227-
name = strings.Replace(name, "/", "-", -1)
227+
name = strings.ReplaceAll(name, "/", "-")
228228

229229
// ensure name starts with [a-z]
230230
char := name[0]

mantle/harness/harness.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -191,12 +191,13 @@ func (c *H) flushToParent(format string, args ...interface{}) {
191191

192192
// TODO: include test numbers in TAP output.
193193
if p.tap != nil {
194-
name := strings.Replace(c.name, "#", "", -1)
195-
if status == testresult.Fail {
194+
name := strings.ReplaceAll(c.name, "#", "")
195+
switch status {
196+
case testresult.Fail:
196197
fmt.Fprintf(p.tap, "not ok - %s\n", name)
197-
} else if status == testresult.Skip {
198+
case testresult.Skip:
198199
fmt.Fprintf(p.tap, "ok - %s # SKIP\n", name)
199-
} else {
200+
default:
200201
fmt.Fprintf(p.tap, "ok - %s\n", name)
201202
}
202203
}

mantle/harness/harness_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -326,8 +326,8 @@ func TestSubTests(t *testing.T) {
326326
}
327327

328328
func makeRegexp(s string) string {
329-
s = strings.Replace(s, ":NNN:", `:\d\d\d:`, -1)
330-
s = strings.Replace(s, "(N.NNs)", `\(\d*\.\d*s\)`, -1)
329+
s = strings.ReplaceAll(s, ":NNN:", `:\d\d\d:`)
330+
s = strings.ReplaceAll(s, "(N.NNs)", `\(\d*\.\d*s\)`)
331331
return s
332332
}
333333

mantle/harness/testresult/status.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,14 @@ func (s TestResult) Display() string {
3636
green := "\033[32m"
3737
reset := "\033[0m"
3838

39-
if s == Fail {
39+
switch s {
40+
case Fail:
4041
return red + string(s) + reset
41-
} else if s == Warn {
42+
case Warn:
4243
return yellow + string(s) + reset
43-
} else if s == Skip {
44+
case Skip:
4445
return blue + string(s) + reset
45-
} else {
46+
default:
4647
return green + string(s) + reset
4748
}
4849
}

mantle/harness/timeout_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ func TestTimeoutBasic(t *testing.T) {
5050
// In the kola tests, we check for timeouts in the SSH code
5151
// to exit running goroutines
5252

53-
if !(timeToRun-slack < total && total < timeToRun+slack) {
53+
if timeToRun-slack >= total || total >= timeToRun+slack {
5454
t.Errorf("Expected: %v +/- %v, Got: %v", timeToRun, slack, total)
5555
}
5656

@@ -80,7 +80,7 @@ func TestTimeoutNoInterrupt(t *testing.T) {
8080
}
8181
total := time.Since(start)
8282

83-
if !(timeToRun-slack < total && total < timeToRun+slack) {
83+
if timeToRun-slack >= total || total >= timeToRun+slack {
8484
t.Errorf("Expected: %v +/- %v, Got: %v", timeToRun, slack, total)
8585
}
8686
}
@@ -122,7 +122,7 @@ func TestTimeoutMultipleTests(t *testing.T) {
122122
}
123123
total := time.Since(start)
124124

125-
if !(totalTime-slack < total && total < totalTime+slack) {
125+
if totalTime-slack >= total || total >= totalTime+slack {
126126
t.Errorf("Expected: %v +/- %v, Got: %v", totalTime, slack, total)
127127
}
128128
}

mantle/kola/cluster/cluster.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ func (t *TestCluster) SSH(m platform.Machine, cmd string) ([]byte, error) {
145145
errMsg := fmt.Sprintf("ssh: %s", cmd)
146146
// If f does not before the test timeout, the RunWithExecTimeoutCheck
147147
// will end this goroutine and mark the test as failed
148-
t.H.RunWithExecTimeoutCheck(f, errMsg)
148+
t.RunWithExecTimeoutCheck(f, errMsg)
149149
if len(stderr) > 0 {
150150
for _, line := range strings.Split(string(stderr), "\n") {
151151
t.Log(line)

mantle/kola/harness.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1693,7 +1693,7 @@ func makeNonExclusiveTest(bucket int, tests []*register.Test, flight platform.Fl
16931693
for _, t := range tests {
16941694
t := t
16951695
run := func(h *harness.H) {
1696-
tcluster.H.NonExclusiveTestStarted()
1696+
tcluster.NonExclusiveTestStarted()
16971697
testResults.add(h)
16981698
// tcluster has a reference to the wrapper's harness
16991699
// We need a new TestCluster that has a reference to the
@@ -1712,16 +1712,16 @@ func makeNonExclusiveTest(bucket int, tests []*register.Test, flight platform.Fl
17121712
defer collectLogsExternalTest(h, t, newTC)
17131713
}
17141714
if IsWarningOnFailure(t.Name) {
1715-
newTC.H.WarningOnFailure()
1715+
newTC.WarningOnFailure()
17161716
}
17171717

17181718
t.Run(newTC)
17191719
}
17201720
// Each non-exclusive test is run as a subtest of this wrapper test
17211721
if t.Timeout == harness.DefaultTimeoutFlag {
1722-
tcluster.H.RunTimeout(t.Name, run, time.Duration(1)*time.Minute)
1722+
tcluster.RunTimeout(t.Name, run, time.Duration(1)*time.Minute)
17231723
} else {
1724-
tcluster.H.RunTimeout(t.Name, run, t.Timeout)
1724+
tcluster.RunTimeout(t.Name, run, t.Timeout)
17251725
}
17261726
}
17271727
},
@@ -1797,7 +1797,7 @@ func runTest(h *harness.H, t *register.Test, pltfrm string, flight platform.Flig
17971797
}()
17981798

17991799
if t.ClusterSize > 0 {
1800-
var userdata *conf.UserData = t.UserData
1800+
var userdata = t.UserData
18011801

18021802
options := platform.MachineOptions{
18031803
MultiPathDisk: t.MultiPathDisk,
@@ -1851,7 +1851,7 @@ func runTest(h *harness.H, t *register.Test, pltfrm string, flight platform.Flig
18511851
}
18521852

18531853
if IsWarningOnFailure(t.Name) {
1854-
tcluster.H.WarningOnFailure()
1854+
tcluster.WarningOnFailure()
18551855
}
18561856

18571857
// Note that we passed in SkipStartMachine=true in our machine

mantle/kola/tests/coretest/core.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -327,9 +327,10 @@ func TestUseradd() error {
327327
// Test that /etc/machine-id isn't empty or COREOS_BLANK_MACHINE_ID
328328
func TestMachineID() error {
329329
id := MachineID()
330-
if id == "" {
330+
switch id {
331+
case "":
331332
return fmt.Errorf("machine-id is empty")
332-
} else if id == "COREOS_BLANK_MACHINE_ID" {
333+
case "COREOS_BLANK_MACHINE_ID":
333334
return fmt.Errorf("machine-id is %s", id)
334335
}
335336
return nil

mantle/kola/tests/crio/crio.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ func crioNetwork(c cluster.TestCluster) {
328328
}
329329

330330
exit, ok := err.(*ssh.ExitError)
331-
if !ok || exit.Waitmsg.ExitStatus() != 1 { // 1 is the expected exit of grep -q
331+
if !ok || exit.ExitStatus() != 1 { // 1 is the expected exit of grep -q
332332
return err
333333
}
334334

0 commit comments

Comments
 (0)