Summarizes git diff into a single git commit message

tools

46 2 months ago

a187ecfa5c01 · 2.2kB
[{"role":"user","content":"\ndiff --git a/cmd/main.go b/cmd/main.go\nindex d40b077..3a2e8ae 100644\n--- a/cmd/main.go\n+++ b/cmd/main.go\n@@ -2,7 +2,6 @@ package main\n\n import (\n \"context\"\n- \"fmt\"\n \"github.com/joho/godotenv\"\n \"github.com/labstack/echo/v4\"\n em \"github.com/labstack/echo/v4/middleware\"\n@@ -62,18 +61,6 @@ func main() {\n panic(err)\n }\n\n- googleBookables, err := gc.GetBookables(context.Background(), nil)\n- if err != nil {\n- panic(err)\n- }\n-\n- googleEvents, err := gc.GetEvents(context.Background(), googleBookables)\n- if err != nil {\n- panic(err)\n- }\n-\n- fmt.Println(googleBookables, googleEvents)\n-\n ec, err := entra.Init(e.Logger)\n if err != nil {\n panic(err)\n@@ -84,13 +71,26 @@ func main() {\n panic(err)\n }\n\n- entraEvents, err := ec.GetEvents(context.Background(), entraBookables)\n+ for i, bookable := range entraBookables {\n+ if bookable.Building == nil {\n+ if bookable.Address != nil {\n+ building, err := gc.GetBuildingByAddress(context.Background(), bookable.Address, nil)\n+ if err != nil {\n+ panic(err)\n+ }\n+ bookable.Building = building\n+ entraBookables[i] = bookable\n+ } else {\n+ log.Infof(\"No building found for address %s\", bookable.Address)\n+ }\n+ }\n+ }\n+\n+ err = gc.PostBookables(context.Background(), entraBookables, nil)\n if err != nil {\n panic(err)\n }\n\n- fmt.Println(entraBookables, entraEvents)\n-\n // Static content\n e.Static(\"/static\", path.Join(htmlLocation, \"static\"))\n"},{"role":"assistant","content":"Refactor Entra bookable processing and remove unused imports and debug prints in main.go"}]