Get retrieves the value at "idx" and return it. If this array has a value at "idx" it returns the value and "true", otherwise it returns "nil" and "false". Since 0.2.0
(idx int32)
| 137 | // |
| 138 | // Since 0.2.0 |
| 139 | func (a *Base) Get(idx int32) (interface{}, bool) { |
| 140 | |
| 141 | bs, ok := a.GetBytes(idx, a.EltEncoder.GetEncodedSize(nil)) |
| 142 | if ok { |
| 143 | _, v := a.EltEncoder.Decode(bs) |
| 144 | return v, true |
| 145 | } |
| 146 | |
| 147 | return nil, false |
| 148 | } |
| 149 | |
| 150 | // GetBytes retrieves the raw data of value in []byte at "idx" and return it. |
| 151 | // |