INNER CODE UNIT · Go
isSupportedFileExtension
kubernetes-sigs/kwok · hack/verify_boilerplate/main.go:72
func isSupportedFileExtension(filePath string) bool {
// check if the file has an extension
idx := strings.LastIndex(filePath, ".")
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 {