This repository has been archived on 2024-05-03. You can view files and clone it, but cannot push or open issues or pull requests.
treefmt/config/config.go
Brian McGee d4ab015bc6
chore: remove internal directory
Signed-off-by: Brian McGee <brian@bmcgee.ie>
2024-02-15 13:59:55 +00:00

19 lines
512 B
Go

package config
import "github.com/BurntSushi/toml"
// Config is used to represent the list of configured Formatters.
type Config struct {
Global struct {
// Excludes is an optional list of glob patterns used to exclude certain files from all formatters.
Excludes []string
}
Formatters map[string]*Formatter `toml:"formatter"`
}
// ReadFile reads from path and unmarshals toml into a Config instance.
func ReadFile(path string) (cfg *Config, err error) {
_, err = toml.DecodeFile(path, &cfg)
return
}