func main() { kingpin.Parse() r, err := recipes.NewRecipe(*name) if err != nil { log.Fatal(err) } m := r.GetMethod(*temp) b, _ := json.MarshalIndent(m, "", " ") fmt.Println(string(b)) }
func GetRecipe(w http.ResponseWriter, req *http.Request) { args := GetArgs(req) recipe, err := recipes.NewRecipe(args.Vars["name"]) if err != nil { return // err } temp := getTemperature(args) method := recipe.GetMethod(temp) json.NewEncoder(w).Encode(method) }