feat(linter): enable errcheck linter in golangci-lint

Also, bump the linter version to the latest available version.

Signed-off-by: Milos Gajdos <milosthegajdos@gmail.com>
This commit is contained in:
Milos Gajdos
2023-11-18 06:50:40 +00:00
parent 9610a1e618
commit 7ce129d63b
36 changed files with 243 additions and 66 deletions

View File

@@ -143,5 +143,8 @@ func (app *testHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
w.WriteHeader(response.StatusCode)
io.Copy(w, bytes.NewReader(response.Body))
if _, err := io.Copy(w, bytes.NewReader(response.Body)); err != nil {
http.Error(w, http.StatusText(http.StatusInternalServerError), http.StatusInternalServerError)
return
}
}

View File

@@ -50,7 +50,9 @@ func MakeSchema2Manifest(repository distribution.Repository, digests []digest.Di
}
builder := schema2.NewManifestBuilder(d, configJSON)
for _, digest := range digests {
builder.AppendReference(distribution.Descriptor{Digest: digest})
if err := builder.AppendReference(distribution.Descriptor{Digest: digest}); err != nil {
return nil, fmt.Errorf("unexpected error building manifest: %v", err)
}
}
mfst, err := builder.Build(ctx)