(b []byte)
| 45 | } |
| 46 | |
| 47 | func (et *ValueType) UnmarshalJSON(b []byte) error { |
| 48 | var s string |
| 49 | if err := json.Unmarshal(b, &s); err != nil { |
| 50 | return err |
| 51 | } |
| 52 | switch s { |
| 53 | case "<ValNone>": |
| 54 | *et = ValNone |
| 55 | case "scalar": |
| 56 | *et = ValScalar |
| 57 | case "vector": |
| 58 | *et = ValVector |
| 59 | case "matrix": |
| 60 | *et = ValMatrix |
| 61 | case "string": |
| 62 | *et = ValString |
| 63 | default: |
| 64 | return fmt.Errorf("unknown value type %q", s) |
| 65 | } |
| 66 | return nil |
| 67 | } |
| 68 | |
| 69 | func (e ValueType) String() string { |
| 70 | switch e { |
nothing calls this directly
no outgoing calls
no test coverage detected