I'm digging into Go's codebase and found a bug in `Buffer.GetBytes`. Here's a playpen to see it in action: https://play.golang.org/p/3-1uLvXD83 I'll send a PR with a fix for this and the corresponding test.