MCPcopy Create free account
hub / github.com/francoispqt/gojay / ExampleBorrowDecoder

Function ExampleBorrowDecoder

decode_example_test.go:121–135  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

119}
120
121func ExampleBorrowDecoder() {
122 reader := strings.NewReader(`"gojay"`)
123 dec := gojay.BorrowDecoder(reader)
124 defer dec.Release()
125
126 var str string
127 err := dec.DecodeString(&str)
128 if err != nil {
129 log.Fatal(err)
130 }
131
132 fmt.Println(str)
133 // Output:
134 // gojay
135}
136
137func ExampleDecoder_DecodeBool() {
138 reader := strings.NewReader(`true`)

Callers

nothing calls this directly

Calls 3

BorrowDecoderFunction · 0.92
DecodeStringMethod · 0.80
ReleaseMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…