if I annotated the fmt.Printf code, the output will be false. but if uncomment the two lines code , it will be true.
why? may the fmt.Printf worked?
this is the code:
package main
import "fmt"
func main() {
type s struct{}
s1 := new(s)
s2 := new(s)
// fmt.Printf("%p\n", s1)
// fmt.Printf("%p\n", s2)
fmt.Println(s1 == s2)
}
i know all the struct{} instance has the same addr, so it should be true always.