loadConfig should not be exported.
This commit is contained in:
parent
79ea7706e1
commit
d7262164f6
1 changed files with 2 additions and 2 deletions
4
main.go
4
main.go
|
@ -157,7 +157,7 @@ var config Config
|
||||||
|
|
||||||
// LoadConfig attempts to read the configuration from options.json
|
// LoadConfig attempts to read the configuration from options.json
|
||||||
// If it fails, it falls back to using environment variables
|
// If it fails, it falls back to using environment variables
|
||||||
func LoadConfig() Config {
|
func loadConfig() Config {
|
||||||
configFilePath := os.Getenv("CONFIG_FILE")
|
configFilePath := os.Getenv("CONFIG_FILE")
|
||||||
if configFilePath == "" {
|
if configFilePath == "" {
|
||||||
configFilePath = "/data/options.json"
|
configFilePath = "/data/options.json"
|
||||||
|
@ -201,7 +201,7 @@ func main() {
|
||||||
slog.SetDefault(logger)
|
slog.SetDefault(logger)
|
||||||
|
|
||||||
// Load the configuration
|
// Load the configuration
|
||||||
config := LoadConfig()
|
config := loadConfig()
|
||||||
|
|
||||||
dbConnStr := config.DB
|
dbConnStr := config.DB
|
||||||
// Connect to PostgreSQL
|
// Connect to PostgreSQL
|
||||||
|
|
Loading…
Reference in a new issue