wynn/go/pkg/config/config.go
a 9a5864b152
Some checks failed
commit-tag / commit-tag-image (push) Successful in 18s
commit-tag / commit-tag-image (./cmd/caddy) (push) Failing after 1m4s
noot
2025-03-02 02:38:31 -06:00

23 lines
360 B
Go

package config
import (
"os"
"go.uber.org/config"
)
func New() (config.Provider, error) {
configFileName := os.Getenv("CONFIG_FILE")
if configFileName == "" {
configFileName = "config.yml"
}
provider, err := config.NewYAML(
config.File("config.yml"),
config.Expand(os.LookupEnv),
)
if err != nil {
return nil, err
}
return provider, nil
}