mirror of
https://github.com/distribution/distribution.git
synced 2025-09-17 07:40:38 +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:
@@ -4,6 +4,7 @@ import (
|
||||
"bufio"
|
||||
"bytes"
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
"net/http"
|
||||
@@ -140,7 +141,9 @@ func (d *driver) PutContent(ctx context.Context, subPath string, contents []byte
|
||||
defer writer.Close()
|
||||
_, err = io.Copy(writer, bytes.NewReader(contents))
|
||||
if err != nil {
|
||||
writer.Cancel(ctx)
|
||||
if cErr := writer.Cancel(ctx); cErr != nil {
|
||||
return errors.Join(err, cErr)
|
||||
}
|
||||
return err
|
||||
}
|
||||
return writer.Commit(ctx)
|
||||
|
Reference in New Issue
Block a user