Set parses the JSON string into the value.
(s string)
| 30 | |
| 31 | // Set parses the JSON string into the value. |
| 32 | func (j *JSONValue) Set(s string) error { |
| 33 | if err := json.Unmarshal([]byte(s), &j.Value); err != nil { |
| 34 | if utils.Contains(j.types, "string") { |
| 35 | j.Value = s |
| 36 | return nil |
| 37 | } |
| 38 | return err |
| 39 | } |
| 40 | return nil |
| 41 | } |
| 42 | |
| 43 | // Type returns the type of the value. |
| 44 | func (j *JSONValue) Type() string { |