stack/source.go
func extractArgumentsType(f *ast.FuncDecl) ([]string, bool) {
	var fields []*ast.Field
	if f.Recv != nil {
		if len(f.Recv.List) != 1 {
			panic("Expect only one receiver; please fix panicparse's code")
		}
		// If it is an object receiver (vs a pointer receiver), its address is not
		// printed in the stack trace so it needs to be ignored.
		if _, ok := f.Recv.List[0].Type.(*ast.StarExpr); ok {
			fields = append(fields, f.Recv.List[0])
		}
	}
	var types []string
	extra := false
	for _, arg := range append(fields, f.Type.Params.List...) {
		// Assert that extra is only set on the last item of fields?
		var t string
		t, extra = fieldToType(arg)
		mult := len(arg.Names)
		if mult == 0 {
			mult = 1
		}
		for i := 0; i < mult; i++ {
			types = append(types, t)
		}
	}
	return types, extra
}
func extractArgumentsType(f *ast.FuncDecl) ([]string, bool) {
	var fields []*ast.Field
	if f.Recv != nil {
		if len(f.Recv.List) != 1 {
			panic("Expect only one receiver; please fix panicparse's code")
		}
		// If it is an object receiver (vs a pointer receiver), its address is not
		// printed in the stack trace so it needs to be ignored.
		if _, ok := f.Recv.List[0].Type.(*ast.StarExpr); ok {
			fields = append(fields, f.Recv.List[0])
		}
	}
	var types []string
	extra := false
	for _, arg := range append(fields, f.Type.Params.List...) {
		// Assert that extra is only set on the last item of fields?
		var t string
		t, extra = fieldToType(arg)
		mult := len(arg.Names)
		if mult == 0 {
			mult = 1
		}
		for i := 0; i < mult; i++ {
			types = append(types, t)
		}
	}
	return types, extra
}
func extractArgumentsType ( f * ast . FuncDecl ) ( [ ] string , bool ) { var fields [ ] * ast . Field if f . Recv != nil { if len ( f . Recv . List ) != 1 { panic ( " " ) } // If it is an object receiver (vs a pointer receiver), its address is not // printed in the stack trace so it needs to be ignored. if _ , ok := f . Recv . List [ 0 ] . Type . ( * ast . StarExpr ) ; ok { fields = append ( fields , f . Recv . List [ 0 ] ) } } var types [ ] string extra := false for _ , arg := range append ( fields , f . Type . Params . List ... ) { // Assert that extra is only set on the last item of fields? var t string t , extra = fieldToType ( arg ) mult := len ( arg . Names ) if mult == 0 { mult = 1 } for i := 0 ; i < mult ; i ++ { types = append ( types , t ) } } return types , extra }
// extractArgumentsType returns the name of the type of each input argument.
extractArgumentsType returns the name of the type of each input argument .