mirror of
https://github.com/protocolbuffers/protobuf-go.git
synced 2025-04-17 11:42:38 +00:00
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 <dneil@google.com> Trust: Damien Neil <dneil@google.com> Trust: Emmanuel Odeke <emmanuel@orijtech.com>
This commit is contained in:
parent
5aec41b480
commit
26e8bcb3c7
@ -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) {
|
||||
|
@ -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:
|
||||
|
Loading…
x
Reference in New Issue
Block a user