package main import ( "log" "os" ) type Config struct { Port string DB string } func LoadConfig() Config { at := os.Getenv("STATSAT") if at == "" { log.Println("Defaulting to STATSAT=:8080") at = ":8080" } db := os.Getenv("STATSDB") if db == "" { log.Println("Defaulting to STATSDB=./stats.db") db = "./stats.db" } return Config{Port: at, DB: db} }