Hex implements formatStringInterpolator.Hex.
(useUpper bool)
| 570 | |
| 571 | // Hex implements formatStringInterpolator.Hex. |
| 572 | func (c *stringFormatChecker) Hex(useUpper bool) func(ref.Val, string) (string, error) { |
| 573 | return func(arg ref.Val, locale string) (string, error) { |
| 574 | id := c.args[c.currArgIndex].ID() |
| 575 | valid := c.verifyTypeOneOf(id, types.IntType, types.UintType, types.StringType, types.BytesType) |
| 576 | if !valid { |
| 577 | return "", hexFormatError(id, c.typeOf(id).TypeName()) |
| 578 | } |
| 579 | return "", nil |
| 580 | } |
| 581 | } |
| 582 | |
| 583 | // Octal implements formatStringInterpolator.Octal. |
| 584 | func (c *stringFormatChecker) Octal(arg ref.Val, locale string) (string, error) { |
nothing calls this directly
no test coverage detected