← Back to archive

Stdle #47 · interfaces · 2026-07-23

What does this Go snippet output?

A past puzzle — fully playable. 4 attempts, hints on wrong guesses.

package main
import "fmt"
type T struct{}
func main() {
var p *T
var i interface{} = p
_, ok := i.(*T)
fmt.Println(i == nil, ok)
}
Interfaces
4 attempts left

Answer & explanation