Skip to content

Commit

Permalink
Some small nits around the codebase to make linters happy. (ko-build#181
Browse files Browse the repository at this point in the history
)
  • Loading branch information
markusthoemmes authored Aug 10, 2020
1 parent 6e4a93e commit ecce857
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions cmd/ko/test/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ func main() {
if err != nil {
log.Fatalf("Error reading %q: %v", file, err)
}
log.Printf(string(bytes))
log.Print(string(bytes))

file = filepath.Join(dp, "refs/heads/master")
bytes, err = ioutil.ReadFile(file)
if err != nil {
log.Fatalf("Error reading %q: %v", file, err)
}
log.Printf(string(bytes))
log.Print(string(bytes))
}
4 changes: 2 additions & 2 deletions pkg/build/gobuild_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ func TestGoBuildNoKoData(t *testing.T) {
}
importpath := "github.com/google/ko"

creationTime := v1.Time{time.Unix(5000, 0)}
creationTime := v1.Time{Time: time.Unix(5000, 0)}
ng, err := NewGo(
WithCreationTime(creationTime),
WithBaseImages(func(string) (v1.Image, error) { return base, nil }),
Expand Down Expand Up @@ -231,7 +231,7 @@ func TestGoBuild(t *testing.T) {
}
importpath := "github.com/google/ko"

creationTime := v1.Time{time.Unix(5000, 0)}
creationTime := v1.Time{Time: time.Unix(5000, 0)}
ng, err := NewGo(
WithCreationTime(creationTime),
WithBaseImages(func(string) (v1.Image, error) { return base, nil }),
Expand Down
2 changes: 1 addition & 1 deletion pkg/commands/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ func getCreationTime() (*v1.Time, error) {
if err != nil {
return nil, fmt.Errorf("the environment variable SOURCE_DATE_EPOCH should be the number of seconds since January 1st 1970, 00:00 UTC, got: %v", err)
}
return &v1.Time{time.Unix(seconds, 0)}, nil
return &v1.Time{Time: time.Unix(seconds, 0)}, nil
}

func createCancellableContext() context.Context {
Expand Down
4 changes: 2 additions & 2 deletions pkg/resolve/resolve_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ func TestStrict(t *testing.T) {
}
}
base := mustRepository("gcr.io/multi-pass")
doc := strToYAML(t, string(buf.Bytes()))
doc := strToYAML(t, buf.String())

err := ImageReferences(context.Background(), []*yaml.Node{doc}, true, testBuilder, kotesting.NewFixedPublish(base, testHashes))
if err != nil {
Expand All @@ -280,7 +280,7 @@ func TestNoStrictKoPrefixRemains(t *testing.T) {
}

base := mustRepository("gcr.io/multi-pass")
doc := strToYAML(t, string(buf.Bytes()))
doc := strToYAML(t, buf.String())

noMatchBuilder := kotesting.NewFixedBuild(nil)

Expand Down

0 comments on commit ecce857

Please sign in to comment.