package planr import ( "github.com/BurntSushi/toml" "log" "path" ) type planrConfig struct { Version string Project_title string } const PLANR_CONFIG = "config.toml" func decodeConfig(configDir string) planrConfig { cfg := planrConfig { } configFile := path.Join(configDir, PLANR_CONFIG) if _, err := toml.DecodeFile(configFile, &cfg); err != nil { // TODO: handle missing config log.Fatalf("Could not decode global configuration %s: %v", configFile, err) } return cfg } func (cfg planrConfig) isIncompatibleWithVersion() bool { return cfg.Version > VERSION }