support goctl version to 1.1.3

This commit is contained in:
MaxToby
2021-01-16 20:44:15 +08:00
parent d06684494a
commit 3ccab1b039
8 changed files with 74 additions and 67 deletions

View File

@ -4,10 +4,11 @@ import (
"bytes"
"encoding/json"
"fmt"
plugin2 "github.com/tal-tech/go-zero/tools/goctl/plugin"
"io/ioutil"
)
func Do(in Plugin) error {
func Do(filename string, in *plugin2.Plugin) error {
swagger, err := applyGenerate(in)
if err != nil {
@ -21,7 +22,7 @@ func Do(in Plugin) error {
}
output := in.Dir + "/" + in.FileName
output := in.Dir + "/" + filename
err = ioutil.WriteFile(output, formatted.Bytes(), 0666)