ParsePreviewSize attempts to convert a string to a PreviewSize
(name string)
| 50 | |
| 51 | // ParsePreviewSize attempts to convert a string to a PreviewSize |
| 52 | func ParsePreviewSize(name string) (PreviewSize, error) { |
| 53 | if x, ok := _PreviewSizeValue[name]; ok { |
| 54 | return x, nil |
| 55 | } |
| 56 | return PreviewSize(0), fmt.Errorf("%s is not a valid PreviewSize, try [%s]", name, strings.Join(_PreviewSizeNames, ", ")) |
| 57 | } |
| 58 | |
| 59 | // MarshalText implements the text marshaller method |
| 60 | func (x PreviewSize) MarshalText() ([]byte, error) { |
no test coverage detected