The doc for Printer.Print
says:
Print is like fmt.Print, but using language-specific formatting.
but I'm having difficult seeing anything language specific compared to Printer.Printf
.
Consider:
package main
import (
"fmt"
"golang.org/x/text/language"
"golang.org/x/text/message"
)
func main() {
message.SetString(language.English, "foo", "bar")
p := message.NewPrinter(language.English)
p.Print("foo")
fmt.Println()
p.Printf("foo")
fmt.Println()
}
Result:
foo
bar
What exactly does Printer.Print
do (that is language specific)?
Package message implements formatted I/O for localized strings with functions analogous to the fmt's print functions. It is a drop-in replacement for fmt.
Language-specific behavior does not distinguish Printer.Print
from Printer.Printf
-- rather it distinguishes each from their analogous functions in the fmt
package. It's right there in the documentation you quoted.