Skip to content

Commit 09365b4

Browse files
authored
Merge pull request #14175 from minikube-bot/auto_bump_golint_version
bump golint version
2 parents cb6f732 + 288f5ef commit 09365b4

File tree

5 files changed

+14
-20
lines changed

5 files changed

+14
-20
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ MINIKUBE_RELEASES_URL=https://github.com/kubernetes/minikube/releases/download
7676
KERNEL_VERSION ?= 4.19.235
7777
# latest from https://github.com/golangci/golangci-lint/releases
7878
# update this only by running `make update-golint-version`
79-
GOLINT_VERSION ?= v1.45.2
79+
GOLINT_VERSION ?= v1.46.1
8080
# Limit number of default jobs, to avoid the CI builds running out of memory
8181
GOLINT_JOBS ?= 4
8282
# see https://github.com/golangci/golangci-lint#memory-usage-of-golangci-lint

cmd/minikube/cmd/service.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ var serviceCmd = &cobra.Command{
109109
services = newServices
110110
}
111111

112-
if services == nil || len(services) == 0 {
112+
if len(services) == 0 {
113113
exit.Message(reason.SvcNotFound, `Service '{{.service}}' was not found in '{{.namespace}}' namespace.
114114
You may select another namespace by using 'minikube service {{.service}} -n <namespace>'. Or list out all the services using 'minikube service list'`, out.V{"service": args[0], "namespace": namespace})
115115
}

pkg/drivers/kic/oci/cgroups_linux.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ import (
3333
func findCgroupMountpoints() (map[string]string, error) {
3434
cgMounts, err := cgroups.GetCgroupMounts(false)
3535
if err != nil {
36-
return nil, fmt.Errorf("Failed to parse cgroup information: %v", err)
36+
return nil, fmt.Errorf("failed to parse cgroup information: %v", err)
3737
}
3838
mps := make(map[string]string)
3939
for _, m := range cgMounts {

pkg/drivers/qemu/qemu.go

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,8 @@ type Driver struct {
7979
DiskPath string
8080
CacheMode string
8181
IOMode string
82-
connectionString string
8382
// conn *libvirt.Connect
8483
// VM *libvirt.Domain
85-
vmLoaded bool
8684
UserDataFile string
8785
CloudConfigRoot string
8886
LocalPorts string
@@ -275,19 +273,19 @@ func parsePortRange(rawPortRange string) (int, int, error) {
275273

276274
minPort, err := strconv.Atoi(portRange[0])
277275
if err != nil {
278-
return 0, 0, fmt.Errorf("Invalid port range")
276+
return 0, 0, fmt.Errorf("invalid port range")
279277
}
280278
maxPort, err := strconv.Atoi(portRange[1])
281279
if err != nil {
282-
return 0, 0, fmt.Errorf("Invalid port range")
280+
return 0, 0, fmt.Errorf("invalid port range")
283281
}
284282

285283
if maxPort < minPort {
286-
return 0, 0, fmt.Errorf("Invalid port range")
284+
return 0, 0, fmt.Errorf("invalid port range")
287285
}
288286

289287
if maxPort-minPort < 2 {
290-
return 0, 0, fmt.Errorf("Port range must be minimum 2 ports")
288+
return 0, 0, fmt.Errorf("port range must be minimum 2 ports")
291289
}
292290

293291
return minPort, maxPort, nil
@@ -327,7 +325,7 @@ func getAvailableTCPPortFromRange(minPort int, maxPort int) (int, error) {
327325
port = p
328326
return port, nil
329327
}
330-
time.Sleep(1)
328+
time.Sleep(1 * time.Second)
331329
}
332330
return 0, fmt.Errorf("unable to allocate tcp port")
333331
}
@@ -368,9 +366,8 @@ func (d *Driver) Start() error {
368366
startCmd = append(startCmd,
369367
"-display", d.DisplayType,
370368
)
371-
} else {
372-
// Use the default graphic output
373369
}
370+
// else use the default graphic output
374371
} else {
375372
if d.Nographic {
376373
startCmd = append(startCmd,

test/integration/functional_test.go

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ import (
4949
"github.com/blang/semver/v4"
5050
"github.com/elazarl/goproxy"
5151
"github.com/hashicorp/go-retryablehttp"
52-
"github.com/otiai10/copy"
52+
cp "github.com/otiai10/copy"
5353
"github.com/phayes/freeport"
5454
"github.com/pkg/errors"
5555
"golang.org/x/build/kubernetes/api"
@@ -480,10 +480,7 @@ func validateDockerEnv(ctx context.Context, t *testing.T, profile string) {
480480
defer cancel()
481481

482482
command := make([]string, len(tc.commandPrefix)+1)
483-
// Would use "copy" built-in here, but that is shadowed by "copy" package
484-
for i, v := range tc.commandPrefix {
485-
command[i] = v
486-
}
483+
copy(command, tc.commandPrefix)
487484

488485
formattedArg := fmt.Sprintf(tc.formatArg, Target(), profile)
489486

@@ -1783,7 +1780,7 @@ func setupFileSync(ctx context.Context, t *testing.T, profile string) {
17831780
p := localSyncTestPath()
17841781
t.Logf("local sync path: %s", p)
17851782
syncFile := filepath.Join(*testdataDir, "sync.test")
1786-
err := copy.Copy(syncFile, p)
1783+
err := cp.Copy(syncFile, p)
17871784
if err != nil {
17881785
t.Fatalf("failed to copy testdata/sync.test: %v", err)
17891786
}
@@ -1792,7 +1789,7 @@ func setupFileSync(ctx context.Context, t *testing.T, profile string) {
17921789

17931790
// Write to a temp file for an atomic write
17941791
tmpPem := localTestCertPath() + ".pem"
1795-
if err := copy.Copy(testPem, tmpPem); err != nil {
1792+
if err := cp.Copy(testPem, tmpPem); err != nil {
17961793
t.Fatalf("failed to copy %s: %v", testPem, err)
17971794
}
17981795

@@ -1816,7 +1813,7 @@ func setupFileSync(ctx context.Context, t *testing.T, profile string) {
18161813

18171814
testPem2 := filepath.Join(*testdataDir, "minikube_test2.pem")
18181815
tmpPem2 := localTestCertFilesPath() + ".pem"
1819-
if err := copy.Copy(testPem2, tmpPem2); err != nil {
1816+
if err := cp.Copy(testPem2, tmpPem2); err != nil {
18201817
t.Fatalf("failed to copy %s: %v", testPem2, err)
18211818
}
18221819

0 commit comments

Comments
 (0)