ParseFormat parses the Format. The empty strings defaults to FormatText.
(s string)
| 103 | // |
| 104 | // The empty strings defaults to FormatText. |
| 105 | func ParseFormat(s string) (Format, error) { |
| 106 | s = strings.ToLower(strings.TrimSpace(s)) |
| 107 | if s == "" { |
| 108 | return FormatText, nil |
| 109 | } |
| 110 | f, ok := stringToFormat[s] |
| 111 | if ok { |
| 112 | return f, nil |
| 113 | } |
| 114 | return 0, fmt.Errorf("unknown format: %q", s) |
| 115 | } |
| 116 | |
| 117 | // FileInfo is a minimal FileInfo interface. |
| 118 | type FileInfo interface { |
no outgoing calls
no test coverage detected
searching dependent graphs…