mirror of
https://github.com/distribution/distribution.git
synced 2025-09-03 16:05:51 +00:00
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:
@@ -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
|
||||
}
|
||||
}
|
||||
|
@@ -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)
|
||||
|
Reference in New Issue
Block a user