func receiverType(fn *ast.FuncDecl) string {
	if fn.Recv == nil || len(fn.Recv.List) == 0 {
		return ""
	}
	switch e := fn.Recv.List[0].Type.(type) {
	case *ast.Ident:
		return e.Name
	case *ast.StarExpr:
		return e.X.(*ast.Ident).Name
	}
	fmt.Println("fn ", fn)
	panic(fmt.Sprintf("unknown method receiver AST node type %T", fn.Recv.List[0].Type))
}
return the name of type of receiver from FunDecl
package caplit
import (
	"fmt"
	"go/ast"
	"go/parser"
	"go/token"
	"os"
	"os/exec"
	"path/filepath"
	"strings"
	"text/template"
	"unicode"
)
type CapnpStructParams struct {
	Name     string
	Template string
}
type CapnpStruct struct {
	Name   string
	Path   string
	Keys   []CapnpStructParams
	Parent string
}
type CapnpFuncDecl struct {
	FuncDecl *ast.FuncDecl
	Path     string
}
func paramType(fn *ast.FuncDecl) string {
	if fn.Type.Params == nil || len(fn.Type.Params.List) == 0 {
		return ""
	}
	switch e := fn.Type.Params.List[0].Type.(type) {
	case *ast.Ident:
		return e.Name
	case *ast.StarExpr:
		switch es := e.X.(type) {
		case *ast.Ident:
			return es.Name
		case *ast.SelectorExpr:
			return es.X.(*ast.Ident).Name + "." + es.Sel.String()
		default:
			panic(fmt.Sprintf("unknown param type %T", e.X))
		}
	case *ast.SelectorExpr:
		switch sel := e.Sel; e.X.(type) {
		case *ast.Ident:
			return sel.Name
		case *ast.SelectorExpr:
			panic("do not enter this phase")
		default:
			panic(fmt.Sprintf("unknown param type %T", e.X))
		}
	case *ast.ArrayType:
		switch es := e.Elt.(type) {
		case *ast.Ident:
			return "[]" + es.Name
		default:
			panic(fmt.Sprintf("unknown param type %T", es))
		}
	}
	panic(fmt.Sprintf("unknown method receiver AST node type %T", fn.Type.Params.List[0].Type))
}