Skip to content

Commit

Permalink
analysis: Rename IsGeneratedFile to IsFileGenerated.
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitshur committed Nov 9, 2015
1 parent a10c166 commit c0a4689
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions analysis/generated_detection.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import (
"strings"
)

// IsGeneratedFile returns true if the specified file is generated, or false if it's handcrafted.
// IsFileGenerated returns true if the specified file is generated, or false if it's handcrafted.
// rootDir is the filepath of root directory, but name is a '/'-separated path to file.
func IsGeneratedFile(rootDir, name string) (bool, error) {
func IsFileGenerated(rootDir, name string) (bool, error) {
switch {
case strings.HasPrefix(name, "Godeps/"):
return true, nil
Expand Down
6 changes: 3 additions & 3 deletions analysis/generated_detection_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ import (
"github.com/shurcooL/go/analysis"
)

func ExampleIsGeneratedFile() {
func ExampleIsFileGenerated() {
cwd, err := os.Getwd()
if err != nil {
panic(err)
}

fmt.Println(analysis.IsGeneratedFile(cwd, "testdata/generated_0.go"))
fmt.Println(analysis.IsGeneratedFile(cwd, "testdata/handcrafted_0.go"))
fmt.Println(analysis.IsFileGenerated(cwd, "testdata/generated_0.go"))
fmt.Println(analysis.IsFileGenerated(cwd, "testdata/handcrafted_0.go"))

// Output:
// true <nil>
Expand Down

0 comments on commit c0a4689

Please sign in to comment.