Hex implements formatStringInterpolatorV2.Hex.
(useUpper bool)
| 510 | |
| 511 | // Hex implements formatStringInterpolatorV2.Hex. |
| 512 | func (c *stringFormatCheckerV2) Hex(useUpper bool) func(ref.Val) (string, error) { |
| 513 | return func(arg ref.Val) (string, error) { |
| 514 | id := c.args[c.currArgIndex].ID() |
| 515 | valid := c.verifyTypeOneOf(id, types.IntType, types.UintType, types.StringType, types.BytesType) |
| 516 | if !valid { |
| 517 | return "", hexFormatErrorV2(id, c.typeOf(id).TypeName()) |
| 518 | } |
| 519 | return "", nil |
| 520 | } |
| 521 | } |
| 522 | |
| 523 | // Octal implements formatStringInterpolatorV2.Octal. |
| 524 | func (c *stringFormatCheckerV2) Octal(arg ref.Val) (string, error) { |
nothing calls this directly
no test coverage detected