Skip to content

Commit 9bddebf

Browse files
committed
Fix lint errors
Signed-off-by: David Gageot <[email protected]>
1 parent f69d8bc commit 9bddebf

File tree

8 files changed

+8
-31
lines changed

8 files changed

+8
-31
lines changed

pkg/skaffold/build/local_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,9 @@ func TestLocalRun(t *testing.T) {
6969
out io.Writer
7070
api docker.DockerAPIClient
7171
tagger tag.Tagger
72-
localCluster bool
7372
artifacts []*v1alpha2.Artifact
7473
expected []Build
74+
localCluster bool
7575
shouldErr bool
7676
}{
7777
{

pkg/skaffold/build/tag/date_time.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,13 @@ type dateTimeTagger struct {
3131
timeFn func() time.Time
3232
}
3333

34-
func NewDateTimeTagger(format, timezone string) (*dateTimeTagger, error) {
34+
// NewDateTimeTagger creates a tagger from a date format and timezone.
35+
func NewDateTimeTagger(format, timezone string) Tagger {
3536
return &dateTimeTagger{
3637
Format: format,
3738
TimeZone: timezone,
3839
timeFn: func() time.Time { return time.Now() },
39-
}, nil
40+
}
4041
}
4142

4243
// GenerateFullyQualifiedImageName tags an image with the supplied image name and the current timestamp

pkg/skaffold/build/tag/date_time_test.go

-8
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,6 @@ import (
2323
"github.com/GoogleContainerTools/skaffold/testutil"
2424
)
2525

26-
type mockClock struct {
27-
time time.Time
28-
}
29-
30-
func (m mockClock) Now() time.Time {
31-
return m.time
32-
}
33-
3426
func TestDateTime_GenerateFullyQualifiedImageName(t *testing.T) {
3527
aLocalTimeStamp := time.Date(2015, 03, 07, 11, 06, 39, 123456789, time.Local)
3628
localZone, _ := aLocalTimeStamp.Zone()

pkg/skaffold/build/tag/env_template.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ type envTemplateTagger struct {
3030
}
3131

3232
// NewEnvTemplateTagger creates a new envTemplateTagger
33-
func NewEnvTemplateTagger(t string) (*envTemplateTagger, error) {
33+
func NewEnvTemplateTagger(t string) (Tagger, error) {
3434
tmpl, err := util.ParseEnvTemplate(t)
3535
if err != nil {
3636
return nil, errors.Wrap(err, "parsing template")

pkg/skaffold/docker/image_test.go

-2
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ func TestMain(m *testing.M) {
3737
type testImageAPI struct {
3838
description string
3939
imageName string
40-
imageID string
4140
tagToImageID map[string]string
4241
shouldErr bool
4342
expected string
@@ -96,7 +95,6 @@ func TestRunBuild(t *testing.T) {
9695
{
9796
description: "build",
9897
tagToImageID: map[string]string{},
99-
imageID: "sha256:test",
10098
expected: "test",
10199
},
102100
{

pkg/skaffold/kubernetes/wait_test.go

-14
Original file line numberDiff line numberDiff line change
@@ -79,20 +79,6 @@ var podBadPhase = &v1.Pod{
7979
},
8080
}
8181

82-
var podDifferentName = &v1.Pod{
83-
ObjectMeta: metav1.ObjectMeta{
84-
Name: "pod_different_name",
85-
},
86-
Status: v1.PodStatus{
87-
Conditions: []v1.PodCondition{
88-
{
89-
Type: v1.PodScheduled,
90-
},
91-
},
92-
Phase: "not a real phase",
93-
},
94-
}
95-
9682
func TestWaitForPodReady(t *testing.T) {
9783
var tests = []struct {
9884
description string

pkg/skaffold/runner/runner.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ func getTagger(t v1alpha2.TagPolicy, customTag string) (tag.Tagger, error) {
141141
return &tag.GitCommit{}, nil
142142

143143
case t.DateTimeTagger != nil:
144-
return tag.NewDateTimeTagger(t.DateTimeTagger.Format, t.DateTimeTagger.TimeZone)
144+
return tag.NewDateTimeTagger(t.DateTimeTagger.Format, t.DateTimeTagger.TimeZone), nil
145145

146146
default:
147147
return nil, fmt.Errorf("Unknown tagger for strategy %+v", t)

pkg/skaffold/util/env_template_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,12 @@ func TestEnvTemplate_ExecuteEnvTemplate(t *testing.T) {
6060
}
6161
for _, test := range tests {
6262
t.Run(test.name, func(t *testing.T) {
63-
test_template := template.Must(template.New("").Parse(test.template))
63+
testTemplate := template.Must(template.New("").Parse(test.template))
6464
OSEnviron = func() []string {
6565
return test.env
6666
}
6767

68-
got, err := ExecuteEnvTemplate(test_template, test.customMap)
68+
got, err := ExecuteEnvTemplate(testTemplate, test.customMap)
6969
testutil.CheckErrorAndDeepEqual(t, test.shouldErr, err, test.want, got)
7070
})
7171
}

0 commit comments

Comments
 (0)