Skip to content

Commit 26e8bcb

Browse files
odeke-emneild
authored andcommitted
all: remove unnecessary string([]byte) conversion in fmt.Sprintf with %s
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]>
1 parent 5aec41b commit 26e8bcb

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

internal/encoding/text/decode.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ func (d *Decoder) currentOpenKind() (Kind, byte) {
381381
case '[':
382382
return ListOpen, ']'
383383
}
384-
panic(fmt.Sprintf("Decoder: openStack contains invalid byte %s", string(openCh)))
384+
panic(fmt.Sprintf("Decoder: openStack contains invalid byte %c", openCh))
385385
}
386386

387387
func (d *Decoder) pushOpenStack(ch byte) {

testing/prototest/message.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -643,7 +643,7 @@ func formatValue(v pref.Value) string {
643643
if err != nil {
644644
return fmt.Sprintf("<%v>", err)
645645
}
646-
return fmt.Sprintf("%v{%v}", v.Descriptor().FullName(), string(b))
646+
return fmt.Sprintf("%v{%s}", v.Descriptor().FullName(), b)
647647
case string:
648648
return fmt.Sprintf("%q", v)
649649
default:

0 commit comments

Comments
 (0)