INNER CODE UNIT · Go

pos

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

		pos = s.end + 1
	}

	if !reflect.DeepEqual(lines, newLines) {
		err = ioutil.WriteFile(path, []byte(strings.Join(newLines, "\n")), 0o600)
		if err != nil {
			log.Fatal(err)
		}
	}
}

var beginPattern = regexp.MustCompile(`<!-- BEGIN SECTION "([^"]*)" "([^"]*)" (true|false) -->`)
var endPattern = regexp.MustCompile(`<!-- END SECTION -->`)

func findNextSection(lines []string, start int) *section {

	for i := start; i < len(lines); i++ {
		m := beginPattern.FindSubmatch([]byte(lines[i]))

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…