value test works

This commit is contained in:
Andreas Schröpfer
2021-02-27 20:40:51 +01:00
parent cc6e58acd9
commit e0faa1fc7c
4 changed files with 261 additions and 0 deletions

View File

@@ -68,3 +68,10 @@ func (c Conf) EncodeJSON(w io.Writer) error {
enc.SetIndent("", " ")
return enc.Encode(c)
}
// DecodeJSON writes the configuration from the reader into
// the pointer of the conf
func (c *Conf) DecodeJSON(r io.Reader) error {
dec := json.NewDecoder(r)
return dec.Decode(c)
}