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

Method UnmarshalJSONArray

decode_array_test.go:653–660  ·  view source on GitHub ↗
(dec *Decoder)

Source from the content-addressed store, hash-verified

651type testArrayStrings [3]string
652
653func (a *testArrayStrings) UnmarshalJSONArray(dec *Decoder) error {
654 var str string
655 if err := dec.String(&str); err != nil {
656 return err
657 }
658 a[dec.Index()] = str
659 return nil
660}
661
662func TestArrayStrings(t *testing.T) {
663 data := []byte(`["a", "b", "c"]`)

Callers

nothing calls this directly

Calls 2

IndexMethod · 0.80
StringMethod · 0.45

Tested by

no test coverage detected