Definition of fmt.Printf

Todd McLeod speeds quickly through the material. I do a lot of pausing to write down what he just said (I’m a visual learner, i.e. I must read it.) Somehow I missed the meaning of fmt.Printf

You can read the docs for it here: https://golang.org/pkg/fmt/#Printf

The short version is this is a way to print out formatted strings. At the top of the fmt package’s documentation they talk about different formatting strings. For instance, %d is how you signify that you want to insert an integer into your formatted string.

Best advice I can give you with something like Printf is just keep using it and slowly it will start to make sense over time. Not all the format strings are easy to remember but with enough practice you will remember the important ones that you need.

Cool. Thanks. I’ll have to look at the fmt package again with that information

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.