(path string)
| 41 | } |
| 42 | |
| 43 | func firstLineFromFile(path string) string { |
| 44 | inFile, err := os.Open(path) |
| 45 | if err != nil { |
| 46 | panic(err) |
| 47 | } |
| 48 | defer inFile.Close() |
| 49 | |
| 50 | scanner := bufio.NewScanner(inFile) |
| 51 | for scanner.Scan() { |
| 52 | return scanner.Text() |
| 53 | } |
| 54 | panic(fmt.Errorf("empty file: " + path)) |
| 55 | } |
| 56 | |
| 57 | const ( |
| 58 | LINT_ERROR = "error" |