MCPcopy Create free account
hub / github.com/ajitpratap0/GoSQLX / isOnlyComments

Function isOnlyComments

pkg/sql/parser/corpus_test.go:140–148  ·  view source on GitHub ↗

isOnlyComments returns true if the string contains only comment lines and whitespace.

(s string)

Source from the content-addressed store, hash-verified

138
139// isOnlyComments returns true if the string contains only comment lines and whitespace.
140func isOnlyComments(s string) bool {
141 for _, line := range strings.Split(s, "\n") {
142 trimmed := strings.TrimSpace(line)
143 if trimmed != "" && !strings.HasPrefix(trimmed, "--") {
144 return false
145 }
146 }
147 return true
148}

Callers 1

splitStatementsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected