()
| 247 | } |
| 248 | |
| 249 | func (i *importer) interfaceImports() fileImports { |
| 250 | std, pkg := buildImports(i.Options, i.Queries, func(name string) bool { |
| 251 | for _, q := range i.Queries { |
| 252 | if q.hasRetType() { |
| 253 | if usesBatch([]Query{q}) { |
| 254 | continue |
| 255 | } |
| 256 | if hasPrefixIgnoringSliceAndPointerPrefix(q.Ret.Type(), name) { |
| 257 | return true |
| 258 | } |
| 259 | } |
| 260 | for _, f := range q.Arg.Pairs() { |
| 261 | if hasPrefixIgnoringSliceAndPointerPrefix(f.Type, name) { |
| 262 | return true |
| 263 | } |
| 264 | } |
| 265 | } |
| 266 | return false |
| 267 | }) |
| 268 | |
| 269 | std["context"] = struct{}{} |
| 270 | |
| 271 | return sortedImports(std, pkg) |
| 272 | } |
| 273 | |
| 274 | func (i *importer) modelImports() fileImports { |
| 275 | std, pkg := buildImports(i.Options, nil, i.usesType) |
no test coverage detected