refactor: simplify codebase
This commit is contained in:
@@ -12,23 +12,11 @@ import (
|
||||
"github.com/BurntSushi/toml"
|
||||
)
|
||||
|
||||
const configFileName = "config.toml"
|
||||
|
||||
// Config is the user-owned TOML configuration for parasocial.
|
||||
type Config struct {
|
||||
Streamers []string `toml:"streamers"`
|
||||
}
|
||||
|
||||
// DefaultPath returns the config file path relative to the current working directory.
|
||||
func DefaultPath() string {
|
||||
return configFileName
|
||||
}
|
||||
|
||||
// LoadDefault reads config from the current working directory.
|
||||
func LoadDefault() (Config, error) {
|
||||
return Load(DefaultPath())
|
||||
}
|
||||
|
||||
// Load reads, normalizes, and validates a TOML config file.
|
||||
func Load(path string) (Config, error) {
|
||||
var cfg Config
|
||||
|
||||
Reference in New Issue
Block a user