aboutsummaryrefslogtreecommitdiff
path: root/src/fmt
diff options
context:
space:
mode:
authorPaul Jolly <paul@myitcv.io>2023-05-24 05:51:09 +0100
committerPaul Jolly <paul@myitcv.org.uk>2023-05-24 18:58:06 +0000
commit2a8969cb365a5539b8652d5ac1588aaef78d3e16 (patch)
tree406548cfa049b73c4eeeedf0257bc66a5c1e9d1d /src/fmt
parent5de20f0f34a7bf08bec8af82befc24e3c0ea5d7e (diff)
downloadgo-2a8969cb365a5539b8652d5ac1588aaef78d3e16.tar.xz
fmt: correct documentation for Formatter
Before this CL, the documentation for Formatter suggested that implementers of Format(f State, verb rune) could use Fprint(f) or Sprint(f) to generate output. The Sprint(f) suggestion however is invalid. Fix that by simply suggesting Sprint() alongside Fprint(f). Fixes #60358 Change-Id: I024e996f6360b812968ef2cd5073cb4c223459e3 Reviewed-on: https://go-review.googlesource.com/c/go/+/497379 Reviewed-by: Bryan Mills <bcmills@google.com> Auto-Submit: Ian Lance Taylor <iant@golang.org> Run-TryBot: Paul Jolly <paul@myitcv.org.uk> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Rob Pike <r@golang.org> Reviewed-by: Daniel Martí <mvdan@mvdan.cc> Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Diffstat (limited to 'src/fmt')
-rw-r--r--src/fmt/print.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/fmt/print.go b/src/fmt/print.go
index b3dd43ce04..9c3bd3efec 100644
--- a/src/fmt/print.go
+++ b/src/fmt/print.go
@@ -50,7 +50,7 @@ type State interface {
// Formatter is implemented by any value that has a Format method.
// The implementation controls how State and rune are interpreted,
-// and may call Sprint(f) or Fprint(f) etc. to generate its output.
+// and may call Sprint() or Fprint(f) etc. to generate its output.
type Formatter interface {
Format(f State, verb rune)
}