INNER CODE UNIT · Go

ext

kubernetes-sigs/kwok · hack/verify_boilerplate/main.go:80

	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, "#")

		// find the start of the boilerplate
		bpLine := boilerPlate[idx]
		if strings.Contains(line, boilerPlateStart) {
			foundBoilerplateStart = true

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…