gopaper/config.go

26 lines
383 B
Go

package main
import (
"encoding/json"
"log"
"os"
)
type Config struct {
ImageFilters
Root string
Duration int
}
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)
}
}