Skip to content

why DecodeAll failed? #859

Closed Answered by klauspost
realcp1018 asked this question in Q&A
Sep 14, 2023 · 1 comments · 1 reply
Discussion options

You must be logged in to vote

DecodeAll appends to dst.

Using decoder.DecodeAll(input, dst[:0:len(dst)]) with and also having the WithDecodeAllCapLimit should do it.

Remember to re-use your decoder and not create a new one every time.

It does of course not check if dst is over-sized, so you will need to check that and return an error yourself.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@realcp1018
Comment options

Answer selected by realcp1018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #858 on September 14, 2023 09:09.