MCPcopy Index your code
hub / github.com/rubenv/sql-migrate / endsWithSemicolon

Function endsWithSemicolon

sqlparse/sqlparse.go:43–57  ·  view source on GitHub ↗

Checks the line to see if the line has a statement-ending semicolon or if the line contains a double-dash comment.

(line string)

Source from the content-addressed store, hash-verified

41// Checks the line to see if the line has a statement-ending semicolon
42// or if the line contains a double-dash comment.
43func 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
59type migrationDirection int
60

Callers 2

TestSemicolonsMethod · 0.85
ParseMigrationFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestSemicolonsMethod · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…