There's no reason we can't support a %v variant verb. Of course it makes type unification more difficult, and certain uses of this will produce unsolvable situations, but it's useful for debugging, and fun to have.
11 lines
197 B
Plaintext
11 lines
197 B
Plaintext
import "fmt"
|
|
|
|
test "printf-a" {
|
|
anotherstr => fmt.printf("the %s is: %d", "answer", 42),
|
|
}
|
|
|
|
$format = "a %s is: %f"
|
|
test "printf-b" {
|
|
anotherstr => fmt.printf($format, "cool number", 3.14159),
|
|
}
|