MarshalJSON implements the json.Marshaler interface for Type.
()
| 49 | |
| 50 | // MarshalJSON implements the json.Marshaler interface for Type. |
| 51 | func (t Type) MarshalJSON() ([]byte, error) { |
| 52 | s := t.String() |
| 53 | if s == "" { |
| 54 | return []byte("null"), nil |
| 55 | } |
| 56 | |
| 57 | return fmt.Appendf(nil, "%q", s), nil |
| 58 | } |
| 59 | |
| 60 | // IsVector checks if the image type is a vector format. |
| 61 | func (t Type) IsVector() bool { |