MCPcopy
hub / github.com/tinylib/msgp / typeName

Method typeName

gen/spec.go:561–576  ·  view source on GitHub ↗

typeName returns the type, e.g. "uint8" or "[2]uint64"

()

Source from the content-addressed store, hash-verified

559
560// typeName returns the type, e.g. "uint8" or "[2]uint64"
561func (b *bmask) typeName() string {
562 if b.bitlen <= 8 {
563 return "uint8"
564 }
565 if b.bitlen <= 16 {
566 return "uint16"
567 }
568 if b.bitlen <= 32 {
569 return "uint32"
570 }
571 if b.bitlen <= 64 {
572 return "uint64"
573 }
574
575 return fmt.Sprintf("[%d]uint64", (b.bitlen+64-1)/64)
576}
577
578// readExpr returns the expression to read from a position in the bitmask.
579// Compare ==0 for false or !=0 for true.

Callers 1

typeDeclMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected