From fc87393cc3963fab0df1b5c9d60e1be07947c78f Mon Sep 17 00:00:00 2001 From: Miles Yucht Date: Fri, 17 Jan 2025 16:42:48 +0100 Subject: [PATCH] fix test --- openapi/roll/tool.go | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/openapi/roll/tool.go b/openapi/roll/tool.go index 9acf159bb..3ed40f355 100644 --- a/openapi/roll/tool.go +++ b/openapi/roll/tool.go @@ -20,34 +20,32 @@ func NewSuite(dirname string) (*Suite, error) { fset: fset, ServiceToPackage: map[string]string{}, } - err := filepath.WalkDir(dirname, func(path string, info os.DirEntry, err error) error { - if err != nil { - return err - } - if info.IsDir() { - return nil + entries, err := os.ReadDir(dirname) + if err != nil { + return nil, err + } + for _, entry := range entries { + if entry.IsDir() { + continue } + path := filepath.Join(dirname, entry.Name()) if strings.HasSuffix(path, "acceptance_test.go") { // not transpilable - return nil + continue } if strings.HasSuffix(path, "files_test.go") { // not transpilable - return nil + continue } if strings.HasSuffix(path, "workspaceconf_test.go") { // not transpilable - return nil + continue } file, err := parser.ParseFile(fset, path, nil, parser.ParseComments) if err != nil { - return err + return nil, err } s.expectExamples(file) - return nil - }) - if err != nil { - return nil, err } err = s.parsePackages(dirname+"/../workspace_client.go", "WorkspaceClient") if err != nil {