LoadFromFile loads a recipe from a YAML file.
(path string)
| 171 | |
| 172 | // LoadFromFile loads a recipe from a YAML file. |
| 173 | func LoadFromFile(path string) (*Recipe, error) { |
| 174 | data, err := os.ReadFile(path) |
| 175 | if err != nil { |
| 176 | return nil, fmt.Errorf("read recipe file: %w", err) |
| 177 | } |
| 178 | |
| 179 | return LoadFromBytes(data) |
| 180 | } |
| 181 | |
| 182 | // LoadFromBytes parses a recipe from YAML bytes. |
| 183 | func LoadFromBytes(data []byte) (*Recipe, error) { |
no test coverage detected