neko/server/internal/utils/json.go

11 lines
200 B
Go
Raw Normal View History

2020-01-19 12:30:09 +13:00
package utils
import "encoding/json"
func Unmarshal(in interface{}, raw []byte, callback func() error) error {
if err := json.Unmarshal(raw, &in); err != nil {
return err
}
return callback()
}