encoding/base64: improve documentation on decoding to a short dst #69024
Labels
Documentation
Issues describing a change to documentation.
FixPending
Issues that have a fix which has not yet been reviewed or submitted.
Milestone
As seen in the issue #50117, providing a
dst
slice that is valid in size (a multiple of what base64 data decode into) but not large enough for the entire source base64 causes a panic. I was surprised to see that it wasn't documented, and from the function comment:A reader would assume that this would therefore decode at most input, (implying a shorter amount would also be possible). I understand that this is not an intended use case, however it should be more explicitly documented that a shorter
dst
will panic.The text was updated successfully, but these errors were encountered: