This is a creation in Article, where the information may have evolved or changed.
Original
Basic
%vthe value in a default Formatwhen printing structs, the plus flag (%+v) adds field names% #va go-syntax representation of The Value%ta go-syntax representation of the type of the value%%a literal percent sign; Consumes no value
The default format for%V is:
BOOL:%tint, int8 etc.:%duint, Uint8 etc.:%d,% #x if printed with% #vfloat32, complex , etc:%gstring:%schan:%ppointer:%p
Boolean:
%tthe Word True or false
Integer:
%bbase 2%cthe character represented by the corresponding Unicode code point%dbase 10%obase 8%qa single-quoted character Li Teral safely escaped with Go Syntax.%xbase +, with lower-case letters for A-f%xbase, with upper-case letters for a-f%u Unicode format:u+1234; Same as "u+%04x"
Floating-point and complex constituents:
%bdecimalless scientific notation with exponent a power of two,in the manner of StrConv. Formatfloat with the ' B ' format,e.g. -123456p-78%escientific notation, e.g. -1.234456e+78%escientific notation, e.g.-1.2 34456e+78%fdecimal Point and no exponent, e.g. 123.456%fsynonym for%f%g%e for large exponents,%f otherwise%g%e for large Exponents,%F otherwise
String and slice of bytes (treated equivalently with these verbs):
%sthe uninterpreted bytes of the string or Slice%qa double-quoted string safely escaped with Go Syntax%xbase, Lower-cas E, characters per Byte%xbase, upper-case, characters per byte
Pointer:
%pbase notation, with leading 0x