Answers for "golang printf placeholders"

Go
4

go format string

s := fmt.Sprintf("string: %s number: %d time: %v", "string", 1, time.Now())
Posted by: Guest on April-10-2020
0

%+v in golang

%v	the value in a default format
	when printing structs, the plus flag (%+v) adds field names
%#v	a Go-syntax representation of the value
%T	a Go-syntax representation of the type of the value
%%	a literal percent sign; consumes no value
Posted by: Guest on December-19-2020

Browse Popular Code Answers by Language