()
| 116 | } |
| 117 | |
| 118 | func outputFile() (*os.File, error) { |
| 119 | filename := *out |
| 120 | if filename == "-" || (filename == "" && *tmplFile == "") { |
| 121 | return os.Stdout, nil |
| 122 | } |
| 123 | if filename == "" { |
| 124 | filename = strings.TrimSuffix(strings.TrimSuffix(*tmplFile, ".tmpl"), ".go") + ".go" |
| 125 | } |
| 126 | return os.Create(filename) |
| 127 | } |
| 128 | |
| 129 | // analyzeCode takes the types scope and the docs and returns the import |
| 130 | // information and information about all the assertion functions. |