1
0
mirror of https://github.com/ko-build/ko.git synced 2025-11-06 09:19:12 +02:00

Some small nits around the codebase to make linters happy. (#181)

This commit is contained in:
Markus Thömmes
2020-08-10 17:21:31 +02:00
committed by GitHub
parent 6e4a93eee0
commit ecce857be6
4 changed files with 7 additions and 7 deletions

View File

@@ -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))
}

View File

@@ -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 }),
@@ -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 }),

View File

@@ -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 {

View File

@@ -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 {
@@ -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)