google / cel-go

Fast, portable, non-Turing complete expression evaluation with gradual typing (Go)
https://cel.dev
Apache License 2.0
2.3k stars 224 forks source link

Fix incorrect example in string formatting docs. #873

Closed nicksnyder closed 11 months ago

nicksnyder commented 11 months ago

%s is defined to support "all numerical types (int, uint, and double)." but later the docs also say: "Passing an incorrect type (an integer to %s) is considered an error"

The example in the parenthetical contradicts the definition of %s.

This change replaces the parenthetical example with one that is accurate and verified by an existing test case. This change also adds an explicit test case to verify that it is valid to pass an int to %s.

TristonianJones commented 11 months ago

/gcbrun