|
|
@ -2,7 +2,6 @@ package ktgen
|
|
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
"fmt"
|
|
|
|
"log"
|
|
|
|
|
|
|
|
"os"
|
|
|
|
"os"
|
|
|
|
"path/filepath"
|
|
|
|
"path/filepath"
|
|
|
|
"text/template"
|
|
|
|
"text/template"
|
|
|
@ -137,11 +136,7 @@ func genApi(dir, pkg string, api *spec.ApiSpec) error {
|
|
|
|
|
|
|
|
|
|
|
|
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)
|
|
|
|
|
|
|
|
if e != nil {
|
|
|
|
|
|
|
|
log.Fatal(e)
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return nil
|
|
|
|
return t.Execute(file, api)
|
|
|
|
}
|
|
|
|
}
|
|
|
|