refactor: simplify codebase

This commit is contained in:
2026-07-17 22:26:53 +00:00
parent 0ae1b094c5
commit 20209a9b6d
26 changed files with 291 additions and 904 deletions
-12
View File
@@ -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
-6
View File
@@ -46,12 +46,6 @@ func TestLoadRejectsInvalidTOML(t *testing.T) {
}
}
func TestDefaultPathUsesCurrentWorkingDirectoryConfig(t *testing.T) {
if got := DefaultPath(); got != "config.toml" {
t.Fatalf("DefaultPath() = %q, want %q", got, "config.toml")
}
}
func TestLoadRejectsMissingFile(t *testing.T) {
path := filepath.Join(t.TempDir(), "missing.toml")