diff --git a/tape/dynamic.go b/tape/dynamic.go index 2528ace..bded11f 100644 --- a/tape/dynamic.go +++ b/tape/dynamic.go @@ -129,7 +129,7 @@ func decodeAny(decoder *Decoder, destination reflect.Value, tag Tag) (n int, err return n, errWrongDestinationType("slice") } if destination.Cap() < int(length) { - destination.Grow(destination.Cap() - int(length)) + destination.Grow(int(length) - destination.Cap()) } destination.SetLen(int(length)) for index := range length {