Load reads and validates a YAML config file.
(path string)
| 106 | |
| 107 | // Load reads and validates a YAML config file. |
| 108 | func Load(path string) (*Config, error) { |
| 109 | b, err := os.ReadFile(path) |
| 110 | if err != nil { |
| 111 | return nil, fmt.Errorf("config: read %s: %w", path, err) |
| 112 | } |
| 113 | return Parse(b) |
| 114 | } |
| 115 | |
| 116 | // Parse validates a YAML document in memory. Exported so the TUI can |
| 117 | // validate as the user types. |
no test coverage detected