func Read(path string) (recipeMain RecipeMain) { file, err := ioutil.ReadFile(path) if err != nil { fmt.Println("Recipe read error: ", err) } file = util.NormalizeUTF8BOM(file) json.Unmarshal(file, &recipeMain) return }
func Read(crafter string) Config { config := Config2{} file, err := ioutil.ReadFile("cfg/" + crafter + ".json") if err != nil { fmt.Println("Config read error: ", err) } file = util.NormalizeUTF8BOM(file) json.Unmarshal(file, &config) return parse(config) }