Is there a way to name string format variables, or otherwise correlate the format with the parameters by something other than their order in the source code?
For example:
bill := "Bill"
max := "Max"
s := "%person walks his dog %dog down the street."
fmt.Sprintf(s, person: bill, dog: max)
Result:
"Bill walks his dog Max down the street."
The reason for this is that I want to be able to arbitrarily change the format string based on a configuration file, without having to worry about the order of the format parameters.
Is there a built-in way to do this, or am I stuck implementing something myself?