diff --git a/tools/goctl/api/ktgen/gen.go b/tools/goctl/api/ktgen/gen.go index e6842fb4..45f5eb75 100644 --- a/tools/goctl/api/ktgen/gen.go +++ b/tools/goctl/api/ktgen/gen.go @@ -7,7 +7,6 @@ import ( "text/template" "github.com/iancoleman/strcase" - "github.com/tal-tech/go-zero/core/logx" "github.com/tal-tech/go-zero/tools/goctl/api/spec" ) @@ -116,7 +115,6 @@ object Api{ func genBase(dir, pkg string, api *spec.ApiSpec) error { e := os.MkdirAll(dir, 0755) if e != nil { - logx.Error(e) return e } path := filepath.Join(dir, "BaseApi.kt") @@ -126,19 +124,16 @@ func genBase(dir, pkg string, api *spec.ApiSpec) error { file, e := os.OpenFile(path, os.O_CREATE|os.O_TRUNC|os.O_WRONLY, 0644) if e != nil { - logx.Error(e) return e } defer file.Close() t, e := template.New("n").Parse(apiBaseTemplate) if e != nil { - logx.Error(e) return e } e = t.Execute(file, pkg) if e != nil { - logx.Error(e) return e } return nil @@ -150,13 +145,11 @@ func genApi(dir, pkg string, api *spec.ApiSpec) error { e := os.MkdirAll(dir, 0755) if e != nil { - logx.Error(e) return e } file, e := os.OpenFile(path, os.O_WRONLY|os.O_TRUNC|os.O_CREATE, 0644) if e != nil { - logx.Error(e) return e } defer file.Close() diff --git a/tools/goctl/goctl.go b/tools/goctl/goctl.go index 1e6b357d..56d0bd26 100644 --- a/tools/goctl/goctl.go +++ b/tools/goctl/goctl.go @@ -2,9 +2,9 @@ package main import ( "fmt" - "github.com/tal-tech/go-zero/tools/goctl/api/ktgen" "os" + "github.com/tal-tech/go-zero/tools/goctl/api/ktgen" "github.com/tal-tech/go-zero/core/logx" "github.com/tal-tech/go-zero/tools/goctl/api/apigen" "github.com/tal-tech/go-zero/tools/goctl/api/dartgen"