示例#1
0
func (vis *getUsedMethodsVisitor) checkEditME(callExpr *ast.CallExpr, mId *ast.Ident) {
	m, ok := vis.identMap.GetSymbol(mId).(*st.FunctionSymbol)
	if !ok {
		panic("couldn't find method selector in method expression")
	}
	if id, ok := callExpr.Args[0].(*ast.Ident); ok {
		if vis.identMap.GetSymbol(id) == vis.varS {
			callExpr.Fun = &ast.SelectorExpr{id, mId}
			callExpr.Args = callExpr.Args[1:]
			vis.result[m] = true
		}
	}
}