Skip to content

Commit ff8901b

Browse files
committed
internal: simplify IsNotExist a bit
1 parent 57618ca commit ff8901b

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

internal/s3util/s3util.go

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,9 @@ import (
1919
// IsNotExist reports whether err is an error indicating the requested resource
2020
// was not found, taking into account S3 and standard library types.
2121
func IsNotExist(err error) bool {
22-
var notFound *types.NotFound
23-
if errors.As(err, &notFound) {
24-
return true
25-
}
26-
var noSuchKey *types.NoSuchKey
27-
if errors.As(err, &noSuchKey) {
22+
var e1 *types.NotFound
23+
var e2 *types.NoSuchKey
24+
if errors.As(err, &e1) || errors.As(err, &e2) {
2825
return true
2926
}
3027
return errors.Is(err, os.ErrNotExist)

0 commit comments

Comments
 (0)