INNER CODE UNIT · Go
decisions
xo/usql · agents_test.go:173
func decisions(t *testing.T) []decision {
t.Helper()
dir := filepath.Join("docs", "decisions")
entries, err := os.ReadDir(dir)
if err != nil {
t.Fatal(err)
}
head := regexp.MustCompile(`\A# D(\d+)\. (.+)\n\nStatus: (.+)\.\n`)
var out []decision
for _, e := range entries {
if e.Name() == "README.md" {
continue
}
name := decisionFile.FindStringSubmatch(e.Name())
if name == nil {
t.Errorf("%s: a decision file is named D, three digits, a hyphen and the"+
" title in lower case words, such as D002-a-large-project.md", e.Name())
continue