ast.go
func (ft *FunctionType) printArgs(ps *printState) {
	paren := false
	space := false
	for i := len(ps.inner) - 1; i >= 0; i-- {
		switch ps.inner[i].(type) {
		case *PointerType, *ReferenceType, *RvalueReferenceType:
			paren = true
		case *TypeWithQualifiers, *ComplexType, *ImaginaryType, *PtrMem:
			space = true
			paren = true
		}
		if paren {
			break
		}
	}

	if paren {
		if !space && (ps.last != '(' && ps.last != '*') {
			space = true
		}
		if space && ps.last != ' ' {
			ps.writeByte(' ')
		}
		ps.writeByte('(')
	}

	save := ps.printInner(true)

	if paren {
		ps.writeByte(')')
	}

	ps.writeByte('(')
	first := true
	for _, a := range ft.Args {
		if ps.isEmpty(a) {
			continue
		}
		if !first {
			ps.writeString(", ")
		}
		ps.print(a)
		first = false
	}
	ps.writeByte(')')

	ps.inner = save
	ps.printInner(false)
}
func (ft *FunctionType) printArgs(ps *printState) {
	paren := false
	space := false
	for i := len(ps.inner) - 1; i >= 0; i-- {
		switch ps.inner[i].(type) {
		case *PointerType, *ReferenceType, *RvalueReferenceType:
			paren = true
		case *TypeWithQualifiers, *ComplexType, *ImaginaryType, *PtrMem:
			space = true
			paren = true
		}
		if paren {
			break
		}
	}

	if paren {
		if !space && (ps.last != '(' && ps.last != '*') {
			space = true
		}
		if space && ps.last != ' ' {
			ps.writeByte(' ')
		}
		ps.writeByte('(')
	}

	save := ps.printInner(true)

	if paren {
		ps.writeByte(')')
	}

	ps.writeByte('(')
	first := true
	for _, a := range ft.Args {
		if ps.isEmpty(a) {
			continue
		}
		if !first {
			ps.writeString(", ")
		}
		ps.print(a)
		first = false
	}
	ps.writeByte(')')

	ps.inner = save
	ps.printInner(false)
}
func ( ft * FunctionType ) printArgs ( ps * printState ) { paren := false space := false for i := len ( ps . inner ) - 1 ; i >= 0 ; i -- { switch ps . inner [ i ] . ( type ) { case * PointerType , * ReferenceType , * RvalueReferenceType : paren = true case * TypeWithQualifiers , * ComplexType , * ImaginaryType , * PtrMem : space = true paren = true } if paren { break } } if paren { if ! space && ( ps . last != '(' && ps . last != '*' ) { space = true } if space && ps . last != ' ' { ps . writeByte ( ' ' ) } ps . writeByte ( '(' ) } save := ps . printInner ( true ) if paren { ps . writeByte ( ')' ) } ps . writeByte ( '(' ) first := true for _ , a := range ft . Args { if ps . isEmpty ( a ) { continue } if ! first { ps . writeString ( " " ) } ps . print ( a ) first = false } ps . writeByte ( ')' ) ps . inner = save ps . printInner ( false ) }
// printArgs prints the arguments of a function type.  It looks at the
// inner types for spacing.
printArgs prints the arguments of a function type . It looks at the inner types for spacing .