INNER CODE UNIT · Go

sectionStart

kluctl/kluctl · internal/replace-commands-help/main.go:160

	if sectionStart == -1 {
		log.Fatalf("Section %s not found in command %s", section, command)
	}

	var ret []string
	ret = append(ret, lines[sectionStart])
	for i := sectionStart + 1; i < len(lines); i++ {
		indent := countIndent(lines[i])
		if len(lines[i]) != 0 && indent == 0 && lines[i][len(lines[i])-1] == ':' {
			// new section has started
			break
		}
		ret = append(ret, lines[i])
	}
	return ret
}

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…