print more message when parse error (#131)

* rebase upstream

* rebase

* trim no need line

* trim no need line

* trim no need line

* update doc

* remove update

* remove no need

* remove no need

* goctl add jwt support

* goctl add jwt support

* goctl add jwt support

* goctl support import

* goctl support import

* support return ()

* revert

* refactor and rename folder to group

* print more error info when parse error

* remove no need

* refactor

Co-authored-by: kingxt <dream4kingxt@163.com>
This commit is contained in:
kingxt
2020-10-16 15:56:29 +08:00
committed by GitHub
parent fe3739b7f3
commit dc0534573c
2 changed files with 37 additions and 31 deletions

View File

@@ -60,7 +60,8 @@ func NewParser(filename string) (*Parser, error) {
func (p *Parser) Parse() (api *spec.ApiSpec, err error) {
api = new(spec.ApiSpec)
types, err := parseStructAst(p.typeDef)
var sp = StructParser{Src: p.typeDef}
types, err := sp.Parse()
if err != nil {
return nil, err
}