garble build main.go exec ./main cmp stderr main.stderr -- main.go -- package main import ( "encoding/json" "go/ast" ) var V interface{} type T struct { ast.Node *ast.Ident } type EncodingT struct { Foo int } func main() { switch V := V.(type) { case int: var _ int = V case nil: println("nil case") } enc, _ := json.Marshal(EncodingT{Foo: 3}) println(string(enc)) } -- main.stderr -- nil case {"Foo":3}