/usr/share/gocode/src/github.com/valyala/bytebufferpool/bytebuffer_example_test.go is in golang-github-valyala-bytebufferpool-dev 0.0~git20160817.0.e746df9-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | package bytebufferpool_test
import (
"fmt"
"github.com/valyala/bytebufferpool"
)
func ExampleByteBuffer() {
bb := bytebufferpool.Get()
bb.WriteString("first line\n")
bb.Write([]byte("second line\n"))
bb.B = append(bb.B, "third line\n"...)
fmt.Printf("bytebuffer contents=%q", bb.B)
// It is safe to release byte buffer now, since it is
// no longer used.
bytebufferpool.Put(bb)
}
|