typeName returns the type, e.g. "uint8" or "[2]uint64"
()
| 559 | |
| 560 | // typeName returns the type, e.g. "uint8" or "[2]uint64" |
| 561 | func (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. |