Skip to content

Commit

Permalink
fix type convert error (#395)
Browse files Browse the repository at this point in the history
  • Loading branch information
kingxt authored Jan 16, 2021
1 parent 4db2067 commit 43e712d
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion tools/goctl/plugin/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,10 +161,26 @@ func NewPlugin() (*Plugin, error) {
if err != nil {
return nil, err
}
err = json.Unmarshal(content, &plugin)

var info struct {
ApiFilePath string
Style string
Dir string
}
err = json.Unmarshal(content, &info)
if err != nil {
return nil, err
}

plugin.ApiFilePath = info.ApiFilePath
plugin.Style = info.Style
plugin.Dir = info.Dir
api, err := parser.Parse(info.ApiFilePath)
if err != nil {
return nil, err
}

plugin.Api = api
return &plugin, nil
}

Expand Down

0 comments on commit 43e712d

Please sign in to comment.