()
| 64 | } |
| 65 | |
| 66 | func main() { |
| 67 | flag.Usage = usage |
| 68 | flag.Parse() |
| 69 | |
| 70 | sort.Sort(byDate(fixes)) |
| 71 | |
| 72 | if *allowedRewrites != "" { |
| 73 | allowed = make(map[string]bool) |
| 74 | for _, f := range strings.Split(*allowedRewrites, ",") { |
| 75 | allowed[f] = true |
| 76 | } |
| 77 | } |
| 78 | |
| 79 | if *forceRewrites != "" { |
| 80 | force = make(map[string]bool) |
| 81 | for _, f := range strings.Split(*forceRewrites, ",") { |
| 82 | force[f] = true |
| 83 | } |
| 84 | } |
| 85 | |
| 86 | if flag.NArg() == 0 { |
| 87 | if err := processFile("standard input", true); err != nil { |
| 88 | report(err) |
| 89 | } |
| 90 | os.Exit(exitCode) |
| 91 | } |
| 92 | |
| 93 | for i := 0; i < flag.NArg(); i++ { |
| 94 | path := flag.Arg(i) |
| 95 | switch dir, err := os.Stat(path); { |
| 96 | case err != nil: |
| 97 | report(err) |
| 98 | case dir.IsDir(): |
| 99 | if err := walkDir(path); err != nil { |
| 100 | report(err) |
| 101 | } |
| 102 | default: |
| 103 | if err := processFile(path, false); err != nil { |
| 104 | report(err) |
| 105 | } |
| 106 | } |
| 107 | } |
| 108 | |
| 109 | os.Exit(exitCode) |
| 110 | } |
| 111 | |
| 112 | const parserMode = parser.ParseComments |
| 113 |
nothing calls this directly
no test coverage detected