diff options
Diffstat (limited to 'internal/config/config.go')
-rw-r--r-- | internal/config/config.go | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/internal/config/config.go b/internal/config/config.go index 361246e..e330a48 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -3,11 +3,37 @@ package config import ( "fmt" "io/ioutil" + "strings" ) type Map map[string]interface{} type Feeds map[string]*Feed +func (f Feeds) String() string { + var b strings.Builder + app := func(a ...interface{}) { + _, _ = fmt.Fprint(&b, a...) + } + app("Feeds [") + + first := true + for k, v := range f { + if !first { + app(", ") + } + app(`"`, k, `"`, ": ") + if v == nil { + app("<nil>") + } else { + _, _ = fmt.Fprintf(&b, "%+v", *v) + } + first = false + } + app("]") + + return b.String() +} + type Config struct { GlobalConfig Map Feeds Feeds |