MCPcopy Index your code
hub / github.com/dunglas/httpsfv / UnmarshalItem

Function UnmarshalItem

item.go:40–59  ·  view source on GitHub ↗

UnmarshalItem parses an item as defined in https://httpwg.org/specs/rfc9651.html#parse-item.

(v []string)

Source from the content-addressed store, hash-verified

38// UnmarshalItem parses an item as defined in
39// https://httpwg.org/specs/rfc9651.html#parse-item.
40func UnmarshalItem(v []string) (Item, error) {
41 s := &scanner{
42 data: strings.Join(v, ","),
43 }
44
45 s.scanWhileSp()
46
47 sfv, err := parseItem(s)
48 if err != nil {
49 return Item{}, err
50 }
51
52 s.scanWhileSp()
53
54 if !s.eof() {
55 return Item{}, &UnmarshalError{off: s.off}
56 }
57
58 return sfv, nil
59}
60
61func parseItem(s *scanner) (Item, error) {
62 bi, err := parseBareItem(s)

Callers 4

TestDecodeErrorFunction · 0.85
TestUnmarshalItemFunction · 0.85

Calls 3

scanWhileSpMethod · 0.95
eofMethod · 0.95
parseItemFunction · 0.85

Tested by 4

TestDecodeErrorFunction · 0.68
TestUnmarshalItemFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…