diff --git a/.golangci.yml b/.golangci.yml index 89d00e25..a9ccf98a 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -6,6 +6,7 @@ run: linters: enable: - gofmt + - gosimple - govet - depguard - goimports diff --git a/commands/ls.go b/commands/ls.go index 33a84f29..f5295ac0 100644 --- a/commands/ls.go +++ b/commands/ls.go @@ -319,7 +319,7 @@ func (tp truncatedPlatforms) String() string { if tpf, ok := tp.res[mpf]; ok { seen[mpf] = struct{}{} if len(tpf) == 1 { - out = append(out, fmt.Sprintf("%s", tpf[0])) + out = append(out, tpf[0]) count++ } else { hasPreferredPlatform := false @@ -347,7 +347,7 @@ func (tp truncatedPlatforms) String() string { continue } if len(tp.res[mpf]) == 1 { - out = append(out, fmt.Sprintf("%s", tp.res[mpf][0])) + out = append(out, tp.res[mpf][0]) count++ } else { hasPreferredPlatform := false diff --git a/controller/pb/progress.go b/controller/pb/progress.go index 5883cfca..dd68e7b4 100644 --- a/controller/pb/progress.go +++ b/controller/pb/progress.go @@ -22,9 +22,7 @@ func (w *writer) Write(status *client.SolveStatus) { w.ch <- ToControlStatus(status) } -func (w *writer) WriteBuildRef(target string, ref string) { - return -} +func (w *writer) WriteBuildRef(target string, ref string) {} func (w *writer) ValidateLogSource(digest.Digest, interface{}) bool { return true diff --git a/util/dockerutil/progress.go b/util/dockerutil/progress.go index 62294309..352d1fce 100644 --- a/util/dockerutil/progress.go +++ b/util/dockerutil/progress.go @@ -55,7 +55,7 @@ func fromReader(l progress.SubLogger, rc io.ReadCloser) error { Started: &now, } } - timeDelta := time.Now().Sub(st.Timestamp) + timeDelta := time.Since(st.Timestamp) if timeDelta < minTimeDelta { continue }