Hacker News new | ask | show | jobs
by NateDad 4434 days ago
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.