Closed
Description
What version of Go are you using?
go version go1.11.4 windows/amd64
What did you do?
https://play.golang.org/p/pbZJx5AZHpJ
What did you expect to see?
The byte slice returned by hex.DecodeString
has len == cap
.
What did you see instead?
The byte slice returned by hex.DecodeString
is twice as large as strictly necessary.
See this rillig/pkglint commit for the real-life example where I discovered this. In a commit message shortly before that, I discovered strange sequences of hex digits in the heap dump.