INNER CODE UNIT · Go
verifyBoilerplate
kubernetes/kubeadm · kinder/hack/verify-boilerplate.go:84
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
// validate the year of the copyright
yearWords := strings.Split(line, " ")
expectedLen := len(strings.Split(boilerPlate[0], " "))
if len(yearWords) != expectedLen {