(ref *gen.Elem, id string, e gen.Elem)
| 61 | } |
| 62 | |
| 63 | func (fs *FileSet) nextShim(ref *gen.Elem, id string, e gen.Elem) { |
| 64 | if (*ref).TypeName() == id { |
| 65 | vn := (*ref).Varname() |
| 66 | *ref = e.Copy() |
| 67 | (*ref).SetVarname(vn) |
| 68 | } else { |
| 69 | switch el := (*ref).(type) { |
| 70 | case *gen.Struct: |
| 71 | for i := range el.Fields { |
| 72 | fs.nextShim(&el.Fields[i].FieldElem, id, e) |
| 73 | } |
| 74 | case *gen.Array: |
| 75 | fs.nextShim(&el.Els, id, e) |
| 76 | case *gen.Slice: |
| 77 | fs.nextShim(&el.Els, id, e) |
| 78 | case *gen.Map: |
| 79 | fs.nextShim(&el.Value, id, e) |
| 80 | if el.Key != nil { |
| 81 | fs.nextShim(&el.Key, id, e) |
| 82 | } |
| 83 | case *gen.Ptr: |
| 84 | fs.nextShim(&el.Value, id, e) |
| 85 | } |
| 86 | } |
| 87 | } |
| 88 | |
| 89 | // propInline identifies and inlines candidates |
| 90 | func (fs *FileSet) propInline() { |
no test coverage detected