func findMatches()

in scripts/generate_schema_docs/main.go [86:101]


func findMatches(path string) ([][]byte, error) {
	if filepath.Ext(path) != ".hcl" {
		return nil, nil
	}

	b, err := ioutil.ReadFile(path)
	if err != nil {
		return nil, err
	}

	matches := schemaRE.FindSubmatch(b)
	if l := len(matches); l != 0 && l != 2 {
		return nil, fmt.Errorf("unexpected number of matches: got %q, want 0 or 2", len(matches))
	}
	return matches, nil
}