This commit is contained in:
2019-11-26 09:07:19 +01:00
parent a112fa589f
commit 0deab5858d
8 changed files with 181 additions and 33 deletions

View File

@ -6,6 +6,7 @@ import (
"io"
"log"
"os"
"time"
)
// FoodOfTheDay is the food list of the day
@ -21,7 +22,7 @@ type Food struct {
}
// GetFoodOfTheDay return the list of food of the day
func GetFoodOfTheDay(Today string) FoodOfTheDay {
func GetFoodOfTheDay() FoodOfTheDay {
foodcsv, _ := os.Open("foodlist/foods.csv")
foodreader := csv.NewReader(bufio.NewReader(foodcsv))
foods := FoodOfTheDay{}
@ -35,7 +36,7 @@ func GetFoodOfTheDay(Today string) FoodOfTheDay {
food := Food{line[0], line[1]}
foods.Foods = append(foods.Foods, food)
}
foods.Date = Today
foods.Date = time.Now().Format("02/01/2006")
return foods
}