func (d *Decoder) parseString(in []byte) (string, int, error) { … } // indexNeedEscapeInBytes returns the index of the character that needs // escaping. If no characters need escaping, this returns the input length. func indexNeedEscapeInBytes(b []byte) int { … }