in format.go [981:1008]
func (un *formatter) writeOperatorWithWrapping(fun, unmangled string) bool {
_, wrapOperatorExists := un.options.operatorsToWrapOn[fun]
lineLength := un.dst.Len() - un.lastWrappedIndex + len(fun)
if wrapOperatorExists && lineLength >= un.options.wrapOnColumn {
un.lastWrappedIndex = un.dst.Len()
// wrapAfterColumnLimit flag dictates whether the newline is placed
// before or after the operator
if un.options.wrapAfterColumnLimit {
// Input: a && b
// Output: a &&\nb
un.WriteString(" ")
un.WriteString(unmangled)
un.WriteString("\n")
} else {
// Input: a && b
// Output: a\n&& b
un.WriteString("\n")
un.WriteString(unmangled)
un.WriteString(" ")
}
return true
}
un.WriteString(" ")
un.WriteString(unmangled)
un.WriteString(" ")
return false
}