Skip to content

Commit

Permalink
all: remove unnecessary string([]byte) conversion in fmt.Sprintf with %s
Browse files Browse the repository at this point in the history
Change-Id: I64aab811cbcbfa410817894f1cd1d83f88f27bf6
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/365874
Reviewed-by: Damien Neil <[email protected]>
Trust: Damien Neil <[email protected]>
Trust: Emmanuel Odeke <[email protected]>
  • Loading branch information
odeke-em authored and neild committed Nov 29, 2021
1 parent 5aec41b commit 26e8bcb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion internal/encoding/text/decode.go
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ func (d *Decoder) currentOpenKind() (Kind, byte) {
case '[':
return ListOpen, ']'
}
panic(fmt.Sprintf("Decoder: openStack contains invalid byte %s", string(openCh)))
panic(fmt.Sprintf("Decoder: openStack contains invalid byte %c", openCh))
}

func (d *Decoder) pushOpenStack(ch byte) {
Expand Down
2 changes: 1 addition & 1 deletion testing/prototest/message.go
Original file line number Diff line number Diff line change
Expand Up @@ -643,7 +643,7 @@ func formatValue(v pref.Value) string {
if err != nil {
return fmt.Sprintf("<%v>", err)
}
return fmt.Sprintf("%v{%v}", v.Descriptor().FullName(), string(b))
return fmt.Sprintf("%v{%s}", v.Descriptor().FullName(), b)
case string:
return fmt.Sprintf("%q", v)
default:
Expand Down

0 comments on commit 26e8bcb

Please sign in to comment.