package main
import (
"fmt"
)
type I interface {
M()
}
type T struct {
}
func (t *T) M() {
fmt.Println(t == nil)
}
func main() {
var i I
var t *T
i = t
fmt.Println(i == nil)
i.M()
}
The result is false and true.
The value in both cases is nil and type is *main.T.
I understand that in the first case i == nil is false because the variable i does not have a nil type.
I do not understand why t == nil is true inside the method M().