From: Paul Jolly Date: Wed, 24 May 2023 04:51:09 +0000 (+0100) Subject: fmt: correct documentation for Formatter X-Git-Tag: go1.21rc1~280 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=2a8969cb365a5539b8652d5ac1588aaef78d3e16;p=gostls13.git 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 Auto-Submit: Ian Lance Taylor Run-TryBot: Paul Jolly TryBot-Result: Gopher Robot Reviewed-by: Rob Pike Reviewed-by: Daniel Martí Reviewed-by: Matthew Dempsky --- 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) }