MCPcopy
hub / github.com/apache/casbin / RemoveComments

Function RemoveComments

util/util.go:52–58  ·  view source on GitHub ↗

RemoveComments removes the comments starting with # in the text.

(s string)

Source from the content-addressed store, hash-verified

50
51// RemoveComments removes the comments starting with # in the text.
52func RemoveComments(s string) string {
53 pos := strings.Index(s, "#")
54 if pos == -1 {
55 return s
56 }
57 return strings.TrimSpace(s[0:pos])
58}
59
60// ArrayEquals determines whether two string arrays are identical.
61func ArrayEquals(a []string, b []string) bool {

Callers 5

TestABACTypesFunction · 0.92
enforceMethod · 0.92
AddDefMethod · 0.92
testRemoveCommentsFunction · 0.85

Calls

no outgoing calls

Tested by 2

TestABACTypesFunction · 0.74
testRemoveCommentsFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…