INNER CODE UNIT · Go
idx
kubernetes-sigs/kwok · hack/verify_boilerplate/main.go:75
if idx == -1 {
return false
}
// check if the file has a supported extension
ext := filePath[idx : idx+len(filePath)-idx]
return slices.Contains(supportedExt, ext)
}
// verifyBoilerplate verifies if a string contains the boilerplate
func verifyBoilerplate(contents string) error {
idx := 0
foundBoilerplateStart := false
lines := strings.SplitSeq(contents, "\n")
for line := range lines {
// handle leading comments
line = trimLeadingComment(line, "//")
line = trimLeadingComment(line, "#")