Checks the line to see if the line has a statement-ending semicolon or if the line contains a double-dash comment.
(line string)
| 41 | // Checks the line to see if the line has a statement-ending semicolon |
| 42 | // or if the line contains a double-dash comment. |
| 43 | func endsWithSemicolon(line string) bool { |
| 44 | prev := "" |
| 45 | scanner := bufio.NewScanner(strings.NewReader(line)) |
| 46 | scanner.Split(bufio.ScanWords) |
| 47 | |
| 48 | for scanner.Scan() { |
| 49 | word := scanner.Text() |
| 50 | if strings.HasPrefix(word, "--") { |
| 51 | break |
| 52 | } |
| 53 | prev = word |
| 54 | } |
| 55 | |
| 56 | return strings.HasSuffix(prev, ";") |
| 57 | } |
| 58 | |
| 59 | type migrationDirection int |
| 60 |
no outgoing calls
searching dependent graphs…