You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When you do []byte(s) where s is a string, the runtime can choose to use a capacity larger than the length of s. In this case that choice depends on escape analysis. It chooses 0 in your first case and 32 in your second case (print cap(s) in your Printfs to see this in action).
Closing, as this is not a bug.
What did you do?
https://play.golang.org/p/0EKO_Iju5Ol
What did you expect to see?
What did you see instead?
Does this issue reproduce with the latest release (go1.11)?
yep.
System details
The text was updated successfully, but these errors were encountered: