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

Method skipString

decode_string.go:201–222  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

199}
200
201func (dec *Decoder) skipString() error {
202 for dec.cursor < dec.length || dec.read() {
203 switch dec.data[dec.cursor] {
204 // found the closing quote
205 // let's return
206 case '"':
207 dec.cursor = dec.cursor + 1
208 return nil
209 // solidus found start parsing an escaped string
210 case '\\':
211 dec.cursor = dec.cursor + 1
212 err := dec.skipEscapedString()
213 if err != nil {
214 return err
215 }
216 default:
217 dec.cursor = dec.cursor + 1
218 continue
219 }
220 }
221 return dec.raiseInvalidJSONErr(len(dec.data) - 1)
222}
223
224// Add Values functions
225

Callers 5

skipEscapedStringMethod · 0.95
decodeEmbeddedJSONMethod · 0.95
skipDataMethod · 0.95
TestSkipStringFunction · 0.95

Calls 3

readMethod · 0.95
skipEscapedStringMethod · 0.95
raiseInvalidJSONErrMethod · 0.95

Tested by 2

TestSkipStringFunction · 0.76