refactor: marshaler unmarshaler iface

This commit is contained in:
Inanc Gumus
2019-10-21 15:21:34 +03:00
parent 59865eac28
commit 3ac59459fd
13 changed files with 83 additions and 38 deletions

View File

@ -24,11 +24,11 @@ func encode() ([]byte, error) {
return json.MarshalIndent(l, "", "\t")
}
func decode(data []byte) (l list, err error) {
func decode(data []byte) (l list, _ error) {
if err := json.Unmarshal(data, &l); err != nil {
return nil, err
}
return l, nil
return
}
func decodeFile(path string) (list, error) {