Re:Go 1.3 beta 1 released
by NateDad on Wednesday April 23, 2014 @09:11AM
(#7633694)
I'm actually hugely not a fan of magically rendering code variables in strings. It's super error prone, and way too magical.
If you really want named variables in format strings you can make a template like "My name is {{.Name}} and surname is {{.Surname}}", and render the template with either a map of strings to strings, or a struct with the right named values.
If you really want named variables in format strings you can make a template like "My name is {{.Name}} and surname is {{.Surname}}", and render the template with either a map of strings to strings, or a struct with the right named values.