MCPcopy Create free account
hub / github.com/egonelbre/exp / readNonDeferredSlice

Function readNonDeferredSlice

check-deferslice/testdata/src/example/example.go:139–145  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

137}
138
139func readNonDeferredSlice() {
140 buf := make([]byte, 1024)
141 other := make([]byte, 512)
142 defer func(b []byte) {}(buf)
143 var r myReader
144 r.Read(other) // ok: other is not deferred
145}
146
147// Save/restore pattern should not be flagged.
148

Callers

nothing calls this directly

Calls 1

ReadMethod · 0.95

Tested by

no test coverage detected