gopaper/config.go

25 lines
365 B
Go
Raw Normal View History

2024-10-27 16:21:28 +00:00
package main
import (
"encoding/json"
"log"
"os"
)
type Config struct {
ImageFilters
Root string
}
func (config *Config) load() {
configRaw, err := os.ReadFile("./config.json")
if err != nil {
log.Fatal("Couldn't open config file!", err)
}
err = json.Unmarshal(configRaw, &config)
if err != nil {
log.Fatal("Couldn't unmarshal config!", err)
}
}