testdatenbank im develop env laden

This commit is contained in:
2025-08-10 21:13:09 +02:00
parent 84158683cd
commit 358ca0fffc
2 changed files with 10 additions and 1 deletions
+9
View File
@@ -22,6 +22,8 @@ type Config struct {
// Environment
Environment string
Testing string // "yes" or "no", used to determine if we are in a test environment
}
// defaultConfig gibt die Standard-Konfiguration zurück
@@ -33,6 +35,7 @@ func defaultConfig() *Config {
DebugMode: false,
LogLevel: "INFO",
Environment: "production",
Testing: "no", // Default to "no", can be overridden in tests
}
}
@@ -84,6 +87,12 @@ func LoadConfig() *Config {
config.LogLevel = "DEBUG"
}
}
// Testing in Development
if testing := os.Getenv("TESTING"); testing != "" {
config.Testing = strings.ToLower(testing)
} else {
config.Testing = "no" // Default to "no"
}
return config
}