INNER CODE UNIT · Go

ext

kubernetes/kubeadm · kinder/hack/verify-boilerplate.go:79

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

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

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…