package main import ( "fmt" "github.com/BurntSushi/toml" ) type Config struct { Server struct { Port int Host string } Database struct { Path string } Session struct { LifetimeHours int } OAuth struct { Google OAuthProviderConfig Apple OAuthProviderConfig GitHub OAuthProviderConfig } } type OAuthProviderConfig struct { ClientID string ClientSecret string RedirectURL string } func loadConfig(path string) (*Config, error) { var config Config if _, err := toml.DecodeFile(path, &config); err != nil { return nil, fmt.Errorf("failed to decode config: %w", err) } return &config, nil }