prow/genfiles/genfiles.go
func NewGroup(gc ghFileClient, owner, repo, sha string) (*Group, error) {
	g := &Group{
		Paths:        make(map[string]bool),
		FileNames:    make(map[string]bool),
		PathPrefixes: make(map[string]bool),
		FilePrefixes: make(map[string]bool),
	}

	bs, err := gc.GetFile(owner, repo, genConfigFile, sha)
	if err != nil {
		switch err.(type) {
		case *github.FileNotFound:
			return g, nil
		default:
			return nil, fmt.Errorf("could not get .generated_files: %v", err)
		}
	}

	repoFiles, err := g.load(bytes.NewBuffer(bs))
	if err != nil {
		return nil, err
	}
	for _, f := range repoFiles {
		bs, err = gc.GetFile(owner, repo, f, sha)
		if err != nil {
			return nil, err
		}
		if err = g.loadPaths(bytes.NewBuffer(bs)); err != nil {
			return nil, err
		}
	}

	return g, nil
}
func NewGroup(gc ghFileClient, owner, repo, sha string) (*Group, error) {
	g := &Group{
		Paths:        make(map[string]bool),
		FileNames:    make(map[string]bool),
		PathPrefixes: make(map[string]bool),
		FilePrefixes: make(map[string]bool),
	}

	bs, err := gc.GetFile(owner, repo, genConfigFile, sha)
	if err != nil {
		switch err.(type) {
		case *github.FileNotFound:
			return g, nil
		default:
			return nil, fmt.Errorf("could not get .generated_files: %v", err)
		}
	}

	repoFiles, err := g.load(bytes.NewBuffer(bs))
	if err != nil {
		return nil, err
	}
	for _, f := range repoFiles {
		bs, err = gc.GetFile(owner, repo, f, sha)
		if err != nil {
			return nil, err
		}
		if err = g.loadPaths(bytes.NewBuffer(bs)); err != nil {
			return nil, err
		}
	}

	return g, nil
}
// NewGroup reads the .generated_files file in the root of the repository
// and any referenced path files (from "path-from-repo" commands).