Managing String Literals is a PITA,
Not Just in GoLang but in (All?) Other Languages
When working in Go, or Bash, or PHP, or any other language for that matter I find one of the most tedious tasks that are also very error prone is management of literal strings.
AFAIK no programming language has addressed this head on, ever. If I am right about that, it would be great if Go was the first.
Literal String Management
Management of literal strings occurs especially with URLs and local paths, but also with many other values that end up as literals used in source code. And there is not one good way to handle them, only several different ways all with major cons, and so developers are all over the map in how they handle string literals.
One approach is for a developer to assign a string literals to a named constant, and then use that name constant wherever the value is needed, e.g.: