Decode unmarshals the underlying value attached to the Object to a target variable target should be one of this: - pointer to an empty interface - pointer to a map - pointer to a struct Example: type S struct{ Foo int `json:"foo"` Bar []interface{} `json:"bar"`
(target interface{})
| 105 | // map[string]interface{}{"a": "b"}, struct{ A int }{123}, |
| 106 | // }, target) |
| 107 | func (o *Object) Decode(target interface{}) *Object { |
| 108 | opChain := o.chain.enter("Decode()") |
| 109 | defer opChain.leave() |
| 110 | |
| 111 | if opChain.failed() { |
| 112 | return o |
| 113 | } |
| 114 | |
| 115 | canonDecode(opChain, o.value, target) |
| 116 | return o |
| 117 | } |
| 118 | |
| 119 | // Alias is similar to Value.Alias. |
| 120 | func (o *Object) Alias(name string) *Object { |