Skip to content

Commit

Permalink
Replace some fmt.Errorf
Browse files Browse the repository at this point in the history
  • Loading branch information
chriskuehl committed Sep 21, 2024
1 parent 1d4bc5e commit 6921357
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions server/uploads/uploads.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const (
)

var (
ErrForbiddenExtension = fmt.Errorf("forbidden extension")
ErrForbiddenExtension = errors.New("forbidden extension")

// MIME types which are allowed to be presented as detected.
// TODO: I think we actually only need to prevent text/html (and any HTML
Expand Down Expand Up @@ -74,7 +74,7 @@ func GenUniqueObjectKey() (string, error) {
return "", fmt.Errorf("generating random number: %w", err)
}
if !r.IsInt64() {
return "", fmt.Errorf("random number is not an int64")
return "", errors.New("random number is not an int64")
}
s.WriteByte(storedFileNameChars[r.Int64()])
}
Expand Down

0 comments on commit 6921357

Please sign in to comment.