Documentation
¶
Overview ¶
Package repoconfig is a repo's settings file, .anfra/config.yml: committed, written by hand, and by anfra only through SetString, which changes nothing but the value it sets.
Index ¶
Constants ¶
const FileName = "config.yml"
FileName is the settings file, in the repo's config folder.
Variables ¶
This section is empty.
Functions ¶
func Hint ¶
Hint is how a message names a setting, for a person to find it: ".anfra/config.yml org.url".
func SetString ¶
SetString sets section.key to value in the YAML file at path, as git config sets a key: the file is parsed only to find where things are, and the new file is the old one's bytes with the value's bytes replaced, so comments, order and formatting are untouched; written to a lock file and renamed over the original, so a reader sees one or the other and two writers cannot interleave.
- No file: it is created.
- No section: a block for it is appended at the end, which disturbs nothing above it.
- The key, a scalar on one line: its value's bytes are replaced.
- Anything else (the section without the key, flow style, a value spanning lines): refused, naming the line to write by hand, rather than guessed at.
value must be a plain scalar that reads back as itself; the result is parsed again and checked before it replaces the file.