Fixed implements formatStringInterpolator.Fixed.
(precision *int)
| 535 | |
| 536 | // Fixed implements formatStringInterpolator.Fixed. |
| 537 | func (c *stringFormatChecker) Fixed(precision *int) func(ref.Val, string) (string, error) { |
| 538 | return func(arg ref.Val, locale string) (string, error) { |
| 539 | id := c.args[c.currArgIndex].ID() |
| 540 | // we allow StringType since "NaN", "Infinity", and "-Infinity" are also valid values |
| 541 | valid := c.verifyTypeOneOf(id, types.DoubleType, types.StringType) |
| 542 | if !valid { |
| 543 | return "", fixedPointFormatError(id, c.typeOf(id).TypeName()) |
| 544 | } |
| 545 | return "", nil |
| 546 | } |
| 547 | } |
| 548 | |
| 549 | // Scientific implements formatStringInterpolator.Scientific. |
| 550 | func (c *stringFormatChecker) Scientific(precision *int) func(ref.Val, string) (string, error) { |
nothing calls this directly
no test coverage detected