mirror of
https://github.com/zeromicro/go-zero.git
synced 2025-02-02 16:28:39 +08:00
fix-log-fatal
This commit is contained in:
parent
701208b6f4
commit
693a8b627a
@ -2,7 +2,6 @@ package ktgen
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"log"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"text/template"
|
||||
@ -136,12 +135,8 @@ func genApi(dir, pkg string, api *spec.ApiSpec) error {
|
||||
defer file.Close()
|
||||
|
||||
t, e := template.New("api").Funcs(funcsMap).Parse(apiTemplate)
|
||||
if e != nil {
|
||||
log.Fatal(e)
|
||||
if e!=nil {
|
||||
return e
|
||||
}
|
||||
e = t.Execute(file, api)
|
||||
if e != nil {
|
||||
log.Fatal(e)
|
||||
}
|
||||
return nil
|
||||
return t.Execute(file, api)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user