Skip to content

Commit f74751c

Browse files
authored
Merge pull request #3934 from afbjorklund/more-lint
Clean up lint and other small report card issues
2 parents b9ecb78 + bfc7d79 commit f74751c

File tree

7 files changed

+16
-9
lines changed

7 files changed

+16
-9
lines changed

Makefile

+6-1
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ MINIKUBE_MARKDOWN_FILES := README.md docs CONTRIBUTING.md CHANGELOG.md
7878
MINIKUBE_BUILD_TAGS := container_image_ostree_stub containers_image_openpgp
7979
MINIKUBE_INTEGRATION_BUILD_TAGS := integration $(MINIKUBE_BUILD_TAGS)
8080
SOURCE_DIRS = cmd pkg test
81+
SOURCE_PACKAGES = ./cmd/... ./pkg/... ./test/...
8182

8283
# $(call DOCKER, image, command)
8384
define DOCKER
@@ -237,9 +238,13 @@ gendocs: out/docs/minikube.md
237238
fmt:
238239
@gofmt -l -s -w $(SOURCE_DIRS)
239240

241+
.PHONY: vet
242+
vet:
243+
@go vet $(SOURCE_PACKAGES)
244+
240245
.PHONY: lint
241246
lint:
242-
@golint $(MINIKUBE_TEST_FILES)
247+
@golint -set_exit_status $(SOURCE_PACKAGES)
243248

244249
.PHONY: reportcard
245250
reportcard:

docs/contributors/build_guide.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ $ ./out/minikube start
5757

5858
## Running Tests
5959

60-
#### Unit Tests
60+
### Unit Tests
6161

6262
Unit tests are run on Travis before code is merged. To run as part of a development cycle:
6363

docs/drivers.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ sudo apt install libvirt-bin libvirt-daemon-system qemu-kvm
3636
sudo yum install libvirt-daemon-kvm qemu-kvm
3737
```
3838

39-
Enable,start, and verify the `libvirtd` service has started.
39+
Enable,start, and verify the `libvirtd` service has started.
4040

4141
```shell
4242
sudo systemctl enable libvirtd.service

pkg/minikube/assets/vm_assets.go

+2
Original file line numberDiff line numberDiff line change
@@ -200,10 +200,12 @@ func (m *BinDataAsset) loadData(isTemplate bool) error {
200200
return nil
201201
}
202202

203+
// IsTemplate returns if the asset is a template
203204
func (m *BinDataAsset) IsTemplate() bool {
204205
return m.template != nil
205206
}
206207

208+
// Evaluate evaluates the template to a new asset
207209
func (m *BinDataAsset) Evaluate(data interface{}) (*MemoryAsset, error) {
208210
if !m.IsTemplate() {
209211
return nil, errors.Errorf("the asset %s is not a template", m.AssetName)

pkg/minikube/cluster/mount_test.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ type mockMountHost struct {
2828
T *testing.T
2929
}
3030

31-
func NewMockMountHost(t *testing.T) *mockMountHost {
31+
func newMockMountHost(t *testing.T) *mockMountHost {
3232
return &mockMountHost{
3333
T: t,
3434
cmds: []string{},
@@ -86,7 +86,7 @@ func TestMount(t *testing.T) {
8686
}
8787
for _, tc := range tests {
8888
t.Run(tc.name, func(t *testing.T) {
89-
h := NewMockMountHost(t)
89+
h := newMockMountHost(t)
9090
err := Mount(h, tc.source, tc.target, tc.cfg)
9191
if err != nil {
9292
t.Fatalf("Mount(%s, %s, %+v): %v", tc.source, tc.target, tc.cfg, err)
@@ -99,7 +99,7 @@ func TestMount(t *testing.T) {
9999
}
100100

101101
func TestUnmount(t *testing.T) {
102-
h := NewMockMountHost(t)
102+
h := newMockMountHost(t)
103103
err := Unmount(h, "/mnt")
104104
if err != nil {
105105
t.Fatalf("Unmount(/mnt): %v", err)

pkg/minikube/constants/constants.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ func GetKubeadmCachedImages(imageRepository string, kubernetesVersionStr string)
245245
imageRepository + "kube-apiserver-amd64:" + kubernetesVersionStr,
246246
}
247247

248-
ge_v1_14 := semver.MustParseRange(">=1.14.0")
248+
v1_14plus := semver.MustParseRange(">=1.14.0")
249249
v1_13 := semver.MustParseRange(">=1.13.0 <1.14.0")
250250
v1_12 := semver.MustParseRange(">=1.12.0 <1.13.0")
251251
v1_11 := semver.MustParseRange(">=1.11.0 <1.12.0")
@@ -259,7 +259,7 @@ func GetKubeadmCachedImages(imageRepository string, kubernetesVersionStr string)
259259
}
260260

261261
var podInfraContainerImage string
262-
if ge_v1_14(kubernetesVersion) {
262+
if v1_14plus(kubernetesVersion) {
263263
podInfraContainerImage = imageRepository + "pause-amd64:3.1"
264264
images = append(images, []string{
265265
podInfraContainerImage,

pkg/minikube/tests/provision_mock.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ func (provisioner *MockProvisioner) GetOsReleaseInfo() (*provision.OsRelease, er
8484
return nil, nil
8585
}
8686

87-
// AttemptIPContact attemps to contact an IP and port
87+
// AttemptIPContact attempts to contact an IP and port
8888
func (provisioner *MockProvisioner) AttemptIPContact(dockerPort int) {
8989
}
9090

0 commit comments

Comments
 (0)