Escape Variables with Printf
If I wanted to do the following:
fmt.Printf("Escape this -> %v... Do not escape this -> %v", "Unescaped")
How could I escape the first occurrence of %v
?
\%v
doesn't seem to work. Any ideas?
You can use %% for literal %
%% a literal percent sign; consumes no value
https://golang.org/pkg/fmt/