← Back to archive

Stdle #161 · interfaces · 2026-11-14

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 get() *T { return nil }
func main() {
var i interface{} = get()
fmt.Println(i == nil)
}
Interfaces
4 attempts left

Answer & explanation