Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
GitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
encoding/gob: allocates underlying slice array even if already present #2275
In this code pattern: d := data[i:j] gob.NewDecoder(r).Decode(&d) gob appears to allocate a new underlying array for d even though there is one present already. Thus, for the data to be in data[i:j] it will need to be copied from d again: copy(data[i:j], d) Ideally, this should not be needed.