func splitFunc(s string) (in, out []string) {
	if !strings.HasPrefix(s, "func(") {
		return nil, nil
	}

	i := len("func(") // index of beginning of 'in' arguments
	nparen := 0
	for j := i; j < len(s); j++ {
		switch s[j] {
		case '(':
			nparen++
		case ')':
			nparen--
			if nparen < 0 {
				// found end of parameter list
				out := strings.TrimSpace(s[j+1:])
				if len(out) >= 2 && out[0] == '(' && out[len(out)-1] == ')' {
					out = out[1 : len(out)-1]
				}
				return split(s[i:j]), split(out)
			}
		}
	}
	return nil, nil
}
func splitFunc(s string) (in, out []string) {
	if !strings.HasPrefix(s, "func(") {
		return nil, nil
	}

	i := len("func(") 
	nparen := 0
	for j := i; j < len(s); j++ {
		switch s[j] {
		case '(':
			nparen++
		case ')':
			nparen--
			if nparen < 0 {
				
				out := strings.TrimSpace(s[j+1:])
				if len(out) >= 2 && out[0] == '(' && out[len(out)-1] == ')' {
					out = out[1 : len(out)-1]
				}
				return split(s[i:j]), split(out)
			}
		}
	}
	return nil, nil
}
func splitFunc ( s string ) ( in , out [ ] string ) { if ! strings . HasPrefix ( s , " " ) { return nil , nil } i := len ( " " ) // index of beginning of 'in' arguments nparen := 0 for j := i ; j < len ( s ) ; j ++ { switch s [ j ] { case '(' : nparen ++ case ')' : nparen -- if nparen < 0 { // found end of parameter list out := strings . TrimSpace ( s [ j + 1 : ] ) if len ( out ) >= 2 && out [ 0 ] == '(' && out [ len ( out ) - 1 ] == ')' { out = out [ 1 : len ( out ) - 1 ] } return split ( s [ i : j ] ) , split ( out ) } } } return nil , nil }
// Convert between function type strings and lists of types.
// Using strings makes this a little harder, but it makes
// a lot of the rest of the code easier.  This will all go away
// when we can use go/typechecker directly.
// splitFunc splits "func(x,y,z) (a,b,c)" into ["x", "y", "z"] and ["a", "b", "c"].
Convert between function type strings and lists of types . Using strings makes this a little harder but it makes a lot of the rest of the code easier . This will all go away when we can use go / typechecker directly . splitFunc splits func ( x y z ) ( a b c ) into [ x y z ] and [ a b c ] .