Unmarshal reads the tokens from JSON byte stream.
(b []byte)
| 96 | |
| 97 | // Unmarshal reads the tokens from JSON byte stream. |
| 98 | func (t *Tokens) Unmarshal(b []byte) error { |
| 99 | tj := tokensJSON{} |
| 100 | if err := json.Unmarshal(b, &tj); err != nil { |
| 101 | return err |
| 102 | } |
| 103 | *t = tj.Tokens |
| 104 | return nil |
| 105 | } |
| 106 | |
| 107 | type tokensJSON struct { |
| 108 | Tokens []uint32 `json:"tokens"` |
no outgoing calls