Skip to content

Commit

Permalink
validation: \u escape non-printable chars in error
Browse files Browse the repository at this point in the history
Instead of printing their hexadecimal rune value, use %+q to print them
as \u escape. This is more common.
  • Loading branch information
fho committed May 30, 2024
1 parent e873ff2 commit dec8320
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion internal/command/release_download_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//go:build s3test
//go:build s3test && dbtest

package command

Expand Down
2 changes: 1 addition & 1 deletion internal/validation/validation.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ func StrID(id string) error {
}

if !unicode.IsPrint(r) {
return fmt.Errorf("contains non-printable character: %x", r)
return fmt.Errorf("contains non-printable character: %+q", r)
}
}

Expand Down

0 comments on commit dec8320

Please sign in to comment.