diff --git a/src/fmt/doc.go b/src/fmt/doc.go index 46f30b44e9a722..49365eedf72640 100644 --- a/src/fmt/doc.go +++ b/src/fmt/doc.go @@ -299,6 +299,16 @@ occurred. If the panic is caused by a nil receiver to an Error, String, or GoString method, however, the output is the undecorated string, "". +Many packages whose APIs involve string formatting expose a trio of +functions similar to [Print], [Printf], and [Println]. +For example, the [log.Print], [log.Printf] and [log.Println] functions +forward their arguments to the corresponding functions in this package. +To avoid confusion, other wrapper functions should follow the naming +and behavioral conventions established by this package. +In particular, a single function should not choose between literal +printing (like [Print]) and formatted printing (like [Printf]) +based on the number of arguments; instead, provide separate functions. + # Scanning An analogous set of functions scans formatted text to yield