| 1 | |
| 2 | |
| 3 | |
| 4 | |
| 5 | |
| 6 | |
| 7 | package testdata |
| 8 | |
| 9 | import ( |
| 10 | "encoding/asn1" |
| 11 | "encoding/gob" |
| 12 | "encoding/json" |
| 13 | "encoding/xml" |
| 14 | "io" |
| 15 | ) |
| 16 | |
| 17 | func _() { |
| 18 | type t struct { |
| 19 | a int |
| 20 | } |
| 21 | var v t |
| 22 | var r io.Reader |
| 23 | |
| 24 | json.Unmarshal([]byte{}, v) |
| 25 | json.Unmarshal([]byte{}, &v) |
| 26 | json.NewDecoder(r).Decode(v) |
| 27 | json.NewDecoder(r).Decode(&v) |
| 28 | gob.NewDecoder(r).Decode(v) |
| 29 | gob.NewDecoder(r).Decode(&v) |
| 30 | xml.Unmarshal([]byte{}, v) |
| 31 | xml.Unmarshal([]byte{}, &v) |
| 32 | xml.NewDecoder(r).Decode(v) |
| 33 | xml.NewDecoder(r).Decode(&v) |
| 34 | asn1.Unmarshal([]byte{}, v) |
| 35 | asn1.Unmarshal([]byte{}, &v) |
| 36 | |
| 37 | var p *t |
| 38 | json.Unmarshal([]byte{}, p) |
| 39 | json.Unmarshal([]byte{}, *p) |
| 40 | json.NewDecoder(r).Decode(p) |
| 41 | json.NewDecoder(r).Decode(*p) |
| 42 | gob.NewDecoder(r).Decode(p) |
| 43 | gob.NewDecoder(r).Decode(*p) |
| 44 | xml.Unmarshal([]byte{}, p) |
| 45 | xml.Unmarshal([]byte{}, *p) |
| 46 | xml.NewDecoder(r).Decode(p) |
| 47 | xml.NewDecoder(r).Decode(*p) |
| 48 | asn1.Unmarshal([]byte{}, p) |
| 49 | asn1.Unmarshal([]byte{}, *p) |
| 50 | |
| 51 | var i interface{} |
| 52 | json.Unmarshal([]byte{}, i) |
| 53 | json.NewDecoder(r).Decode(i) |
| 54 | |
| 55 | json.Unmarshal([]byte{}, nil) |
| 56 | json.Unmarshal([]byte{}, []t{}) |
| 57 | json.Unmarshal([]byte{}, map[string]int{}) |
| 58 | json.NewDecoder(r).Decode(nil) |
| 59 | json.NewDecoder(r).Decode([]t{}) |
| 60 | json.NewDecoder(r).Decode(map[string]int{}) |
| 61 | |
| 62 | json.Unmarshal(func() ([]byte, interface{}) { return []byte{}, v }()) |
| 63 | } |
| 64 | |