MCPcopy
hub / github.com/ugorji/go / structFieldNotFound

Method structFieldNotFound

codec/decode.go:1829–1841  ·  view source on GitHub ↗
(index int, rvkencname string)

Source from the content-addressed store, hash-verified

1827}
1828
1829func (d *Decoder) structFieldNotFound(index int, rvkencname string) {
1830 // Note: rvkencname is used only if there is an error, to pass into d.errorf.
1831 // Consequently, it is ok to pass in a stringView
1832 // Since rvkencname may be a stringView, do NOT pass it to another function.
1833 if d.h.ErrorIfNoField {
1834 if index >= 0 {
1835 d.errorf("no matching struct field found when decoding stream array at index %v", index)
1836 } else if rvkencname != "" {
1837 d.errorf("no matching struct field found when decoding stream map with key " + rvkencname)
1838 }
1839 }
1840 d.swallow()
1841}
1842
1843func (d *Decoder) arrayCannotExpand(sliceLen, streamLen int) {
1844 if d.h.ErrorIfNoArrayExpand {

Callers 2

kStructMethod · 0.95

Calls 2

swallowMethod · 0.95
errorfMethod · 0.80

Tested by

no test coverage detected