(fileName string, files []*ast.File, byName map[string]*ast.File)
| 19 | ) |
| 20 | |
| 21 | func generateOpsFile(fileName string, files []*ast.File, byName map[string]*ast.File) (err error) { |
| 22 | return writeFile(fileName, func(f *os.File) error { |
| 23 | return opsTemplate.Execute(f, struct { |
| 24 | UnaryOps, BinaryOps []string |
| 25 | }{ |
| 26 | UnaryOps: findEvalOps( |
| 27 | files, byName[unaryOpsDefinitionsFile], isUnaryEvalMethod, |
| 28 | ).ordered(), |
| 29 | BinaryOps: findEvalOps( |
| 30 | files, byName[binaryOpsDefinitionsFile], isBinaryEvalMethod, |
| 31 | ).ordered(), |
| 32 | }) |
| 33 | }) |
| 34 | } |
| 35 | |
| 36 | func findEvalOps( |
| 37 | files []*ast.File, definitionFile *ast.File, existingMethodFilter func(decl *ast.FuncDecl) bool, |
no test coverage detected
searching dependent graphs…