neko/internal/utils/json.go
2020-10-22 16:54:50 +02:00

11 lines
200 B
Go

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()
}