diff --git a/config.go b/config.go index dc14923..ac5cb9e 100644 --- a/config.go +++ b/config.go @@ -43,7 +43,13 @@ func Load(ctx context.Context, r io.Reader) (*Config, *toml.MetaData, error) { if err != nil { return nil, nil, fmt.Errorf("couldn't decode config: %w", err) } - expandcfg(&cfg, os.Getenv) + expandcfg(&cfg, func(s string) string { + v, ok := os.LookupEnv(s) + if !ok { + slog.ErrorContext(ctx, "config refers to missing environment variable", slog.String("variable", s)) + } + return v + }) return &cfg, &md, nil }