package main import ( "github.com/BurntSushi/toml" "strings" ) type config struct { DocsRoot string TemplateFile string TargetDir string CssFile string BaseUrl string } func readConfig(file string) (cfg config, err error) { _, err = toml.DecodeFile(file, &cfg) cfg.BaseUrl = strings.TrimSuffix(cfg.BaseUrl, "/") return }