File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -12,7 +12,6 @@ import (
1212 "go/token"
1313 "go/types"
1414 "log"
15- "os"
1615 "path/filepath"
1716 "regexp"
1817 "strconv"
@@ -375,11 +374,10 @@ func processRange(metadata *subTData, rastmt *ast.RangeStmt) bool {
375374// resolveTestData resolves test data variable declared in cases_test.go (if exists)
376375// and returns type information for identifier resolution
377376func resolveTestData (fset * token.FileSet , f * ast.File , file string ) * types.Info {
378- filepaths := []string {file }
379- // Add cases_test.go if it exists.
380- dataFile := filepath .Join (filepath .Dir (file ), "cases_test.go" )
381- if _ , err := os .Stat (dataFile ); err == nil {
382- filepaths = append (filepaths , dataFile )
377+ glob := filepath .Join (filepath .Dir (file ), "*_test.go" )
378+ filepaths , err := filepath .Glob (glob )
379+ if err != nil {
380+ return nil
383381 }
384382
385383 files := []* ast.File {f }
You can’t perform that action at this time.
0 commit comments