prow/gitattributes/gitattributes.go
func NewGroup(gitAttributesContent func() ([]byte, error)) (*Group, error) {
	g := &Group{
		LinguistGeneratedPatterns: []Pattern{},
	}

	bs, err := gitAttributesContent()
	if err != nil {
		switch err.(type) {
		case *github.FileNotFound:
			return g, nil
		default:
			return nil, fmt.Errorf("could not get .gitattributes: %v", err)
		}
	}

	if err := g.load(bytes.NewBuffer(bs)); err != nil {
		return nil, err
	}

	return g, nil
}
func NewGroup(gitAttributesContent func() ([]byte, error)) (*Group, error) {
	g := &Group{
		LinguistGeneratedPatterns: []Pattern{},
	}

	bs, err := gitAttributesContent()
	if err != nil {
		switch err.(type) {
		case *github.FileNotFound:
			return g, nil
		default:
			return nil, fmt.Errorf("could not get .gitattributes: %v", err)
		}
	}

	if err := g.load(bytes.NewBuffer(bs)); err != nil {
		return nil, err
	}

	return g, nil
}
func NewGroup ( gitAttributesContent func ( ) ( [ ] byte , error ) ) ( * Group , error ) { g := & Group { LinguistGeneratedPatterns : [ ] Pattern { } , } bs , err := gitAttributesContent ( ) if err != nil { switch err . ( type ) { case * github . FileNotFound : return g , nil default : return nil , fmt . Errorf ( " " , err ) } } if err := g . load ( bytes . NewBuffer ( bs ) ) ; err != nil { return nil , err } return g , nil }
// NewGroup reads the .gitattributes file in the root of the repository only.
NewGroup reads the . gitattributes file in the root of the repository only .