MCPcopy Create free account
hub / github.com/WICG/webpackage / DecodeTextString

Method DecodeTextString

go/internal/cbor/decoder.go:106–115  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

104}
105
106func (d *Decoder) DecodeTextString() (string, error) {
107 bs, err := d.decodeBytesOfType(TypeText)
108 if err != nil {
109 return "", err
110 }
111 if !utf8.Valid(bs) {
112 return "", ErrInvalidUTF8
113 }
114 return string(bs), nil
115}
116
117func (d *Decoder) DecodeByteString() ([]byte, error) {
118 return d.decodeBytesOfType(TypeBytes)

Callers 11

decodeSectionLengthsCBORFunction · 0.95
parseIndexSectionFunction · 0.95
parsePrimarySectionFunction · 0.95
parseManifestSectionFunction · 0.95
parseSignaturesSectionFunction · 0.95
loadMetadataFunction · 0.95
decodeSignedSubsetFunction · 0.95
ReadCertChainFunction · 0.95
decodeSubsetHashesFunction · 0.80

Calls 1

decodeBytesOfTypeMethod · 0.95

Tested by

no test coverage detected