diff --git a/backend/state-manager/cmd/data/nt-tokyo.yaml b/backend/onetime/seed-data/data/nt-tokyo.yaml similarity index 100% rename from backend/state-manager/cmd/data/nt-tokyo.yaml rename to backend/onetime/seed-data/data/nt-tokyo.yaml diff --git a/backend/state-manager/cmd/seed.go b/backend/onetime/seed-data/main.go similarity index 92% rename from backend/state-manager/cmd/seed.go rename to backend/onetime/seed-data/main.go index bc547246..8fa150a7 100644 --- a/backend/state-manager/cmd/seed.go +++ b/backend/onetime/seed-data/main.go @@ -23,13 +23,14 @@ type Seed struct { } func main() { - err := godotenv.Load(".env") - defer db.C() + if err := godotenv.Load(".env"); err != nil { + panic(err) + } db.Open() + defer db.C() data := &Seed{} b, _ := os.ReadFile("./data/nt-tokyo.yaml") - err = yaml.Unmarshal(b, data) - if err != nil { + if err := yaml.Unmarshal(b, data); err != nil { panic(err) }