func (p *pp) doPrintf(format string, a []interface{}) {
argNum := 0 // we process one argument per non-trivial format
afterIndex := false // previous item in format was an index like [3].
for i < end && format[i] != '%' {
p.buf.WriteString(format[lasti:i])
// done processing format string
case '#': //'#'、'0'、'+'、'-'、' '
if 'a' <= c && c <= 'z' && argNum < len(a) {
p.printArg(a[argNum], rune(c))
// Do we have an explicit argument index?
argNum, i, afterIndex = p.argNumber(argNum, format, i, len(a))
if i < end && format[i] == '*' {
if i+1 < end && format[i] == '.' {
argNum, i, afterIndex = p.argNumber(argNum, format, i, len(a))
p.buf.WriteString(noVerbString)
case verb == '%': // Percent does not absorb operands and ignores f.wid and f.prec.
case argNum >= len(a): // No argument left over to print for the current verb.
p.printArg(a[argNum], verb)
if !p.reordered && argNum < len(a) {