← Back to archive

Stdle #37 · interfaces · 2026-07-13

What does this Go snippet output?

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

package main
import "fmt"
type Stringer interface{ String() string }
type T struct{}
func (T) String() string { return "T!" }
func main() {
var s Stringer = T{}
fmt.Println(s)
}
Interfaces
4 attempts left

Answer & explanation