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

Method UnmarshalJSONArray

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

Source from the content-addressed store, hash-verified

675}
676
677func (s *testSliceArraysStrings) UnmarshalJSONArray(dec *Decoder) error {
678 var a testArrayStrings
679 assert.Equal(s.t, len(s.arrays), dec.Index(), "decoded array index must be equal to current slice len")
680 if err := dec.AddArray(&a); err != nil {
681 return err
682 }
683 assert.Equal(s.t, len(s.arrays), dec.Index(), "decoded array index must be equal to current slice len")
684 s.arrays = append(s.arrays, a)
685 return nil
686}
687
688func TestIndex(t *testing.T) {
689 testCases := []struct {

Callers

nothing calls this directly

Calls 2

IndexMethod · 0.80
AddArrayMethod · 0.45

Tested by

no test coverage detected