diff options
author | xengineering <me@xengineering.eu> | 2023-04-22 19:28:54 +0200 |
---|---|---|
committer | xengineering <me@xengineering.eu> | 2023-04-22 19:28:54 +0200 |
commit | 7bb54a56e993723b2867efbafddd1b9abfebcd9e (patch) | |
tree | af9225992fe8cd60552a846403d17e5497ac6ba4 /recipe.go | |
parent | a0cc83b88357e73a6bcae156b26029fc5257ac20 (diff) | |
download | ceres-7bb54a56e993723b2867efbafddd1b9abfebcd9e.tar ceres-7bb54a56e993723b2867efbafddd1b9abfebcd9e.tar.zst ceres-7bb54a56e993723b2867efbafddd1b9abfebcd9e.zip |
Remove legacy Recipe struct
Diffstat (limited to 'recipe.go')
-rw-r--r-- | recipe.go | 13 |
1 files changed, 11 insertions, 2 deletions
@@ -22,11 +22,20 @@ type recipe struct { } } +func getRecipeText(id string) ([]byte, error) { + var b []byte + textpath := filepath.Join(config.Data, "recipes", id, "text") + b, err := ioutil.ReadFile(textpath) + if err != nil { + return b, err + } + return b, nil +} + func getRecipe(id string) (recipe, error) { r := recipe{} - textpath := filepath.Join(config.Data, "recipes", id, "text") - data, err := ioutil.ReadFile(textpath) + data, err := getRecipeText(id) if err != nil { return r, err } |