nbt: fix TagLongArray error message

This commit is contained in:
Tnze
2020-01-05 01:40:14 +08:00
parent 7818d3a0fc
commit 3041792dac

View File

@ -229,9 +229,9 @@ func (d *Decoder) unmarshal(val reflect.Value, tagType byte, tagName string) err
if vt.Kind() == reflect.Interface {
vt = reflect.TypeOf([]int64{}) // pass
} else if vt.Kind() != reflect.Slice {
return errors.New("cannot parse TagIntArray to " + vt.String() + ", it must be a slice")
return errors.New("cannot parse TagLongArray to " + vt.String() + ", it must be a slice")
} else if val.Type().Elem().Kind() != reflect.Int64 {
return errors.New("cannot parse TagIntArray to " + vt.String())
return errors.New("cannot parse TagLongArray to " + vt.String())
}
buf := reflect.MakeSlice(vt, int(aryLen), int(aryLen))