fix-log-fatal

This commit is contained in:
stevenzack
2020-08-16 21:00:45 +08:00
committed by Kevin Wan
parent 701208b6f4
commit 693a8b627a

View File

@@ -2,7 +2,6 @@ package ktgen
import ( import (
"fmt" "fmt"
"log"
"os" "os"
"path/filepath" "path/filepath"
"text/template" "text/template"
@@ -136,12 +135,8 @@ func genApi(dir, pkg string, api *spec.ApiSpec) error {
defer file.Close() defer file.Close()
t, e := template.New("api").Funcs(funcsMap).Parse(apiTemplate) t, e := template.New("api").Funcs(funcsMap).Parse(apiTemplate)
if e != nil { if e!=nil {
log.Fatal(e) return e
} }
e = t.Execute(file, api) return t.Execute(file, api)
if e != nil {
log.Fatal(e)
}
return nil
} }