prow/plugins/golint/golint.go
func modifiedGoFiles(ghc githubClient, org, repo string, number int, sha string) (map[string]string, error) {
	changes, err := ghc.GetPullRequestChanges(org, repo, number)
	if err != nil {
		return nil, err
	}

	gfg, err := genfiles.NewGroup(ghc, org, repo, sha)
	if err != nil {
		return nil, err
	}

	modifiedFiles := make(map[string]string)
	for _, change := range changes {
		switch {
		case strings.HasPrefix(change.Filename, "vendor/"):
			continue
		case filepath.Ext(change.Filename) != ".go":
			continue
		case gfg.Match(change.Filename):
			continue
		case change.Status == github.PullRequestFileRemoved || change.Status == github.PullRequestFileRenamed:
			continue
		}
		modifiedFiles[change.Filename] = change.Patch
	}
	return modifiedFiles, nil
}
func modifiedGoFiles(ghc githubClient, org, repo string, number int, sha string) (map[string]string, error) {
	changes, err := ghc.GetPullRequestChanges(org, repo, number)
	if err != nil {
		return nil, err
	}

	gfg, err := genfiles.NewGroup(ghc, org, repo, sha)
	if err != nil {
		return nil, err
	}

	modifiedFiles := make(map[string]string)
	for _, change := range changes {
		switch {
		case strings.HasPrefix(change.Filename, "vendor/"):
			continue
		case filepath.Ext(change.Filename) != ".go":
			continue
		case gfg.Match(change.Filename):
			continue
		case change.Status == github.PullRequestFileRemoved || change.Status == github.PullRequestFileRenamed:
			continue
		}
		modifiedFiles[change.Filename] = change.Patch
	}
	return modifiedFiles, nil
}
func modifiedGoFiles ( ghc githubClient , org , repo string , number int , sha string ) ( map [ string ] string , error ) { changes , err := ghc . GetPullRequestChanges ( org , repo , number ) if err != nil { return nil , err } gfg , err := genfiles . NewGroup ( ghc , org , repo , sha ) if err != nil { return nil , err } modifiedFiles := make ( map [ string ] string ) for _ , change := range changes { switch { case strings . HasPrefix ( change . Filename , " " ) : continue case filepath . Ext ( change . Filename ) != " " : continue case gfg . Match ( change . Filename ) : continue case change . Status == github . PullRequestFileRemoved || change . Status == github . PullRequestFileRenamed : continue } modifiedFiles [ change . Filename ] = change . Patch } return modifiedFiles , nil }
// modifiedGoFiles returns a map from filename to patch string for all go files
// that are modified in the PR excluding vendor/ and generated files.
modifiedGoFiles returns a map from filename to patch string for all go files that are modified in the PR excluding vendor / and generated files .