MCPcopy Index your code
hub / github.com/nsf/gocode / string

Method string

package_bin.go:660–682  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

658}
659
660func (p *gc_bin_parser) string() string {
661 if p.debugFormat {
662 p.marker('s')
663 }
664 // if the string was seen before, i is its index (>= 0)
665 // (the empty string is at index 0)
666 i := p.rawInt64()
667 if i >= 0 {
668 return p.strList[i]
669 }
670 // otherwise, i is the negative string length (< 0)
671 if n := int(-i); n <= cap(p.buf) {
672 p.buf = p.buf[:n]
673 } else {
674 p.buf = make([]byte, n)
675 }
676 for i := range p.buf {
677 p.buf[i] = p.rawByte()
678 }
679 s := string(p.buf)
680 p.strList = append(p.strList, s)
681 return s
682}
683
684func (p *gc_bin_parser) marker(want byte) {
685 if got := p.rawByte(); got != want {

Callers 11

parse_exportMethod · 0.95
pkgMethod · 0.95
posMethod · 0.95
qualifiedNameMethod · 0.95
typMethod · 0.95
fieldMethod · 0.95
fieldNameMethod · 0.95
paramMethod · 0.95
skipValueMethod · 0.95
floatMethod · 0.95
pathMethod · 0.95

Calls 3

markerMethod · 0.95
rawInt64Method · 0.95
rawByteMethod · 0.95

Tested by

no test coverage detected