package config import ( "log" "encoding/json" "os" ) type config struct { Views string `json:"views"` Layout string `json:"layout"` Target string `json:"target"` WatchDelay string `json:"watch_delay"` SyncDir string `json:"sync_dir"` MetaFiles []string `json:"meta_files"` } var Settings config func Load(path string) { config, err := os.ReadFile(path) if err != nil { log.Fatalf("invalid config path: %s", path) } err = json.Unmarshal(config, &Settings) if err != nil { log.Fatalf("json format error:", err) } }