Print percentage sign when using string formatting in Go

Go

06 Mar 2020 | 1 minute read

When using String Formatting in Go, the % sign is used to specify the type. But what if you want to include a % sign in your print? See the code snippet below:

fmt.Printf("+%d%%", 104)

Which will have the following output:

+104%

Stay in the loop

If you want to take part of new articles and tips and tricks to become a better developer, subscribe to my private email list:

Your thoughts? Please leave a reply 💬