ArinDash/config/config.go
2025-12-22 18:49:05 +01:00

22 lines
316 B
Go

package config
import (
"os"
"github.com/pelletier/go-toml/v2"
)
func LoadConfig(config interface{}) {
if err := toml.Unmarshal(readFile("config.toml"), config); err != nil {
panic(err)
}
}
func readFile(path string) []byte {
data, err := os.ReadFile(path)
if err != nil {
panic(err)
}
return data
}