Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix gen_test.go #960

Merged
merged 2 commits into from
Jul 27, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions gen/gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,6 @@ type Config struct {
// Build builds swagger json file for given searchDir and mainAPIFile. Returns json
func (g *Gen) Build(config *Config) error {
searchDirs := strings.Split(config.SearchDir, ",")
if len(searchDirs) == 0 {
return fmt.Errorf("empty searching dir: %s", config.SearchDir)
}
for _, searchDir := range searchDirs {
if _, err := os.Stat(searchDir); os.IsNotExist(err) {
return fmt.Errorf("dir: %s does not exist", searchDir)
Expand Down
2 changes: 1 addition & 1 deletion gen/gen_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ func TestGen_SearchDirIsNotExist(t *testing.T) {
OutputDir: swaggerConfDir,
PropNamingStrategy: propNamingStrategy,
}
assert.EqualError(t, New().Build(config), "dir: ../isNotExistDir is not exist")
assert.EqualError(t, New().Build(config), "dir: ../isNotExistDir does not exist")
}

func TestGen_MainAPiNotExist(t *testing.T) {
Expand Down