String type asserts to `string`
()
| 200 | |
| 201 | // String type asserts to `string` |
| 202 | func (j *Json) String() (string, error) { |
| 203 | if s, ok := (j.data).(string); ok { |
| 204 | return s, nil |
| 205 | } |
| 206 | return "", errors.New("type assertion to string failed") |
| 207 | } |
| 208 | |
| 209 | // Bytes type asserts to `[]byte` |
| 210 | func (j *Json) Bytes() ([]byte, error) { |
no outgoing calls