Implement calling GetFood from FE

This commit is contained in:
2024-08-09 17:46:50 +02:00
parent 683c443b7f
commit b177416204
6 changed files with 24 additions and 54 deletions

38
main.go
View File

@@ -41,9 +41,6 @@ var (
)
func main() {
// var wg sync.WaitGroup
// wg.Add(1)
dbpath := flag.String("db", "food.db", "Path to the database file")
flag.Parse()
@@ -64,41 +61,6 @@ func main() {
foodService = &FoodService{db: &db}
// _, err = foodService.GetRecent()
// if err != nil {
// Error.Printf("%++v", err)
// os.Exit(1)
// }
// food, err := foodService.Create(Food{food: "test", amount: 1})
// if err != nil {
// Error.Printf("%++v", err)
// os.Exit(1)
// }
// log.Println(food)
// daily, err := foodService.GetDaily()
// if err != nil {
// Error.Printf("%++v", err)
// os.Exit(1)
// }
// log.Println(daily)
// test := Food{
// food: "test",
// amount: rand.Float32(),
// rowid: 766,
// }
// food, err := foodService.Update(test)
// if err != nil {
// Error.Printf("%++v", err)
// os.Exit(1)
// }
// log.Println(food)
// log.Println("done")
// wg.Wait()
// Create an instance of the app structure
app := NewApp()