- Sort Score
- Result 10 results
- Languages All
Results 1 - 1 of 1 for TestNewBufferShallow (0.21 sec)
-
src/bytes/buffer_test.go
var buf Buffer // Calling NewBuffer and immediately shallow copying the Buffer struct // should not result in any allocations. // This can be used to reset the underlying []byte of an existing Buffer. func TestNewBufferShallow(t *testing.T) { testenv.SkipIfOptimizationOff(t) n := testing.AllocsPerRun(1000, func() { buf = *NewBuffer(testBytes) }) if n > 0 { t.Errorf("allocations occurred while shallow copying") }
Registered: Tue Nov 05 11:13:11 UTC 2024 - Last Modified: Tue Sep 03 20:55:15 UTC 2024 - 18.6K bytes - Viewed (0)