Skip to content

Commit

Permalink
delete unused return in "fillDefinition" (swaggo#708)
Browse files Browse the repository at this point in the history
  • Loading branch information
KuboOrk committed Jan 20, 2022
1 parent f942256 commit 1c4100c
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions parser.go
Expand Up @@ -954,10 +954,7 @@ func (parser *Parser) ParseDefinition(typeSpecDef *TypeSpecDef) (*Schema, error)
return nil, err
}

err = fillDefinition(definition, typeSpecDef.File, typeSpecDef)
if err != nil {
return nil, err
}
fillDefinition(definition, typeSpecDef.File, typeSpecDef)

s := Schema{
Name: refTypeName,
Expand Down Expand Up @@ -985,7 +982,7 @@ func fullTypeName(pkgName, typeName string) string {

// fillDefinition additionally fills fields in definition (spec.Schema)
// TODO: If .go file contains many types, it may work for a long time
func fillDefinition(definition *spec.Schema, file *ast.File, typeSpecDef *TypeSpecDef) error {
func fillDefinition(definition *spec.Schema, file *ast.File, typeSpecDef *TypeSpecDef) {
if definition.Description == "" {
for _, astDeclaration := range file.Decls {
generalDeclaration, ok := astDeclaration.(*ast.GenDecl)
Expand All @@ -1001,12 +998,9 @@ func fillDefinition(definition *spec.Schema, file *ast.File, typeSpecDef *TypeSp

definition.Description =
extractDeclarationDescription(typeSpec.Doc, typeSpec.Comment, generalDeclaration.Doc)
return nil
}
}
}

return nil
}

// extractDeclarationDescription gets first description
Expand Down

0 comments on commit 1c4100c

Please sign in to comment.