INNER CODE UNIT · Go
idx
kubernetes/kubeadm · kinder/hack/verify-boilerplate.go:74
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.Split(contents, "\n")
for _, line := range lines {
// handle leading comments
line = trimLeadingComment(line, "//")
line = trimLeadingComment(line, "#")