glog.go
func (buf *buffer) nDigits(n, i, d int, pad byte) {
	j := n - 1
	for ; j >= 0 && d > 0; j-- {
		buf.tmp[i+j] = digits[d%10]
		d /= 10
	}
	for ; j >= 0; j-- {
		buf.tmp[i+j] = pad
	}
}
func (buf *buffer) nDigits(n, i, d int, pad byte) {
	j := n - 1
	for ; j >= 0 && d > 0; j-- {
		buf.tmp[i+j] = digits[d%10]
		d /= 10
	}
	for ; j >= 0; j-- {
		buf.tmp[i+j] = pad
	}
}
func ( buf * buffer ) nDigits ( n , i , d int , pad byte ) { j := n - 1 for ; j >= 0 && d > 0 ; j -- { buf . tmp [ i + j ] = digits [ d % 10 ] d /= 10 } for ; j >= 0 ; j -- { buf . tmp [ i + j ] = pad } }
// nDigits formats an n-digit integer at buf.tmp[i],
// padding with pad on the left.
// It assumes d >= 0.
nDigits formats an n - digit integer at buf . tmp [ i ] padding with pad on the left . It assumes d > = 0 .