- Sort Score
- Result 10 results
- Languages All
Results 1 - 1 of 1 for TestNewBufferShallow (0.07 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 Sep 09 11:13:09 UTC 2025 - Last Modified: Mon May 19 16:13:04 UTC 2025 - 18.6K bytes - Viewed (0)