You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
the following code prints "%p(string=hello)".
this is a direct consequence of the recent changes to
fmt to switch on type first, but it's not helpful behaviour
and it's not easy to work around without importing
reflect and rewriting fmtUintptrGetter.
might i suggest that fmt.printField only check for Stringer/GoStringer
when the verb can actually process a string.
package main
import "fmt"
type T struct{}
func main() { fmt.Printf("%p\n", &T{}) }
func (x *T) String() string { return "hello" }
The text was updated successfully, but these errors were encountered:
Here's a related and to my mind more serious inconsistency.
Println of one argument is supposed to be like Printf with "%v\n" but
this program prints two different lines:
package main
import "fmt"
type T int
func (t T) Format(f fmt.State, c int) {
fmt.Fprintf(f, "-formatted-")
}
func main() {
fmt.Printf("%v\n", T(1))
fmt.Println(T(1))
}
The text was updated successfully, but these errors were encountered: