From c0a4689648baffc6eacad120bbe7d223e7b922c3 Mon Sep 17 00:00:00 2001 From: Dmitri Shuralyov Date: Sun, 8 Nov 2015 18:06:12 -0800 Subject: [PATCH] analysis: Rename IsGeneratedFile to IsFileGenerated. --- analysis/generated_detection.go | 4 ++-- analysis/generated_detection_test.go | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/analysis/generated_detection.go b/analysis/generated_detection.go index 4879cb7..a6ebe87 100644 --- a/analysis/generated_detection.go +++ b/analysis/generated_detection.go @@ -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 diff --git a/analysis/generated_detection_test.go b/analysis/generated_detection_test.go index 8dd84fc..07b1566 100644 --- a/analysis/generated_detection_test.go +++ b/analysis/generated_detection_test.go @@ -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