1
0
mirror of https://github.com/golang/go synced 2024-11-18 13:34:41 -07:00
go/src/fmt
Joe Tsai 9c916c7901 fmt: rely on utf8.AppendRune
This is both simpler and more performant.
The need for fmt.fmtC to manually check for utf8.MaxRune
is subtle to avoid overflow when converting uint64 to rune,
so a test case was added to exercise this edge case.

Change-Id: I0f2e6cce91dcd4cc6b88190c29807ca1c58e999d
Reviewed-on: https://go-review.googlesource.com/c/go/+/412335
Auto-Submit: Joseph Tsai <joetsai@digital-static.net>
Auto-Submit: Robert Griesemer <gri@google.com>
Run-TryBot: Joseph Tsai <joetsai@digital-static.net>
Reviewed-by: Cherry Mui <cherryyz@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@google.com>
Run-TryBot: Robert Griesemer <gri@google.com>
2022-09-21 13:54:31 +00:00
..
doc.go all: gofmt main repo 2022-04-11 16:34:30 +00:00
errors_test.go
errors.go all: gofmt -w -r 'interface{} -> any' src 2021-12-13 18:45:54 +00:00
example_test.go
export_test.go
fmt_test.go fmt: rely on utf8.AppendRune 2022-09-21 13:54:31 +00:00
format.go fmt: rely on utf8.AppendRune 2022-09-21 13:54:31 +00:00
gostringer_example_test.go
print.go fmt: rely on utf8.AppendRune 2022-09-21 13:54:31 +00:00
scan_test.go all: gofmt -w -r 'interface{} -> any' src 2021-12-13 18:45:54 +00:00
scan.go all: gofmt -w -r 'interface{} -> any' src 2021-12-13 18:45:54 +00:00
state_test.go fmt: add a function to recover the original format string given a State 2022-08-06 09:19:31 +00:00
stringer_example_test.go
stringer_test.go