(d ast.Decl)
| 338 | } |
| 339 | |
| 340 | func method_of(d ast.Decl) string { |
| 341 | if t, ok := d.(*ast.FuncDecl); ok { |
| 342 | if t.Recv != nil && len(t.Recv.List) != 0 { |
| 343 | switch t := t.Recv.List[0].Type.(type) { |
| 344 | case *ast.StarExpr: |
| 345 | if se, ok := t.X.(*ast.SelectorExpr); ok { |
| 346 | return se.Sel.Name |
| 347 | } |
| 348 | if ident, ok := t.X.(*ast.Ident); ok { |
| 349 | return ident.Name |
| 350 | } |
| 351 | return "" |
| 352 | case *ast.Ident: |
| 353 | return t.Name |
| 354 | default: |
| 355 | return "" |
| 356 | } |
| 357 | } |
| 358 | } |
| 359 | return "" |
| 360 | } |
| 361 | |
| 362 | func (other *decl) deep_copy() *decl { |
| 363 | d := new(decl) |
no outgoing calls
no test coverage detected