mirror of
https://github.com/m1k1o/neko.git
synced 2024-07-24 14:40:50 +12:00
11 lines
200 B
Go
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()
|
||
|
}
|