From 2a8969cb365a5539b8652d5ac1588aaef78d3e16 Mon Sep 17 00:00:00 2001 From: Paul Jolly Date: Wed, 24 May 2023 05:51:09 +0100 Subject: [PATCH] fmt: correct documentation for Formatter MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 --- src/fmt/print.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) } -- 2.48.1