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

Method notAllSet

gen/spec.go:613–631  ·  view source on GitHub ↗

notAllSet returns a check against all fields having been set in set.

()

Source from the content-addressed store, hash-verified

611
612// notAllSet returns a check against all fields having been set in set.
613func (b *bmask) notAllSet() string {
614 var buf bytes.Buffer
615 buf.Grow(len(b.varname) + 16)
616 buf.WriteString(b.varname)
617 if b.bitlen > 64 {
618 var bytes []string
619 remain := b.bitlen
620 for remain >= 8 {
621 bytes = append(bytes, "0xff")
622 }
623 if remain > 0 {
624 bytes = append(bytes, fmt.Sprintf("0x%X", remain))
625 }
626 fmt.Fprintf(&buf, " != [%d]byte{%s}\n", (b.bitlen+63)/64, strings.Join(bytes, ","))
627 }
628 fmt.Fprintf(&buf, " != 0x%x", uint64(1<<b.bitlen)-1)
629
630 return buf.String()
631}

Callers 2

mapstructMethod · 0.95
structAsMapMethod · 0.95

Calls 2

WriteStringMethod · 0.65
StringMethod · 0.65

Tested by

no test coverage detected