Escape Variables with Printf

前端 未结 1 1838
深忆病人
深忆病人 2021-01-01 11:48

If I wanted to do the following:

fmt.Printf(\"Escape this -> %v... Do not escape this -> %v\", \"Unescaped\")

How could I escape the

相关标签:
1条回答
  • 2021-01-01 12:36

    You can use %% for literal %

    %%  a literal percent sign; consumes no value
    

    https://golang.org/pkg/fmt/

    0 讨论(0)
提交回复
热议问题