()
| 51 | } |
| 52 | |
| 53 | func realmain() error { |
| 54 | flag.Usage = usage |
| 55 | flag.Parse() |
| 56 | |
| 57 | if *showVersion { |
| 58 | fmt.Println(versionStr) |
| 59 | return nil |
| 60 | } |
| 61 | |
| 62 | err := processFiles() |
| 63 | if err != nil { |
| 64 | return err |
| 65 | } |
| 66 | |
| 67 | if checkErrs { |
| 68 | return errors.New("one or more files contained errors") |
| 69 | } |
| 70 | |
| 71 | if *reqNoChange { |
| 72 | if len(changed) != 0 { |
| 73 | return fmt.Errorf("file(s) were changed: %s", strings.Join(changed, ", ")) |
| 74 | } |
| 75 | } |
| 76 | |
| 77 | return nil |
| 78 | } |
| 79 | |
| 80 | func processFiles() error { |
| 81 | if flag.NArg() == 0 { |
no test coverage detected