From 1b74958208060b6affbec956c4fdb5cda7b8a118 Mon Sep 17 00:00:00 2001 From: Raymond Ho Date: Fri, 5 Mar 2021 11:47:22 -0800 Subject: [PATCH] fix formatting --- parser.go | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/parser.go b/parser.go index d488a7b..6042bbf 100644 --- a/parser.go +++ b/parser.go @@ -235,7 +235,6 @@ func (p *parser) parse() error { return nil } - func (p *parser) CreateOASFile(path string) error { if err := p.parse(); err != nil { return err @@ -1064,7 +1063,7 @@ func (p *parser) parseSchemaObject(pkgPath, pkgName, typeName string) (*SchemaOb if err != nil { return nil, err } - schemaObject.AdditionalProperties = schemaProperty + schemaObject.AdditionalProperties = schemaProperty return &schemaObject, nil } else if typeName == "time.Time" { schemaObject.Type = "string" @@ -1137,7 +1136,7 @@ func (p *parser) parseSchemaObject(pkgPath, pkgName, typeName string) (*SchemaOb return &schemaObject, nil } - log.Fatalf("Cannot find definition of guess %s ast.TypeSpec in package %s. " + + log.Fatalf("Cannot find definition of guess %s ast.TypeSpec in package %s. "+ "If definition is in a vendor dependency, try running `go mod tidy && go mod vendor`", guessTypeName, guessPkgName) } @@ -1502,7 +1501,7 @@ func (p *parser) debugf(format string, args ...interface{}) { } } -func sortedPackageKeys(m map[string]*ast.Package) ([]string) { +func sortedPackageKeys(m map[string]*ast.Package) []string { keys := make([]string, len(m)) i := 0 for k, _ := range m { @@ -1513,7 +1512,7 @@ func sortedPackageKeys(m map[string]*ast.Package) ([]string) { return keys } -func sortedFileKeys(m map[string]*ast.File) ([]string) { +func sortedFileKeys(m map[string]*ast.File) []string { keys := make([]string, len(m)) i := 0 for k, _ := range m {