diff --git a/tools/goctl/api/gogen/genmain.go b/tools/goctl/api/gogen/genmain.go index 304c4bf5..9f0df228 100644 --- a/tools/goctl/api/gogen/genmain.go +++ b/tools/goctl/api/gogen/genmain.go @@ -45,6 +45,7 @@ func genMain(dir, rootPkg string, cfg *config.Config, api *spec.ApiSpec) error { if err != nil { return err } + configName := filename if strings.HasSuffix(filename, "-api") { filename = strings.ReplaceAll(filename, "-api", "") @@ -60,7 +61,7 @@ func genMain(dir, rootPkg string, cfg *config.Config, api *spec.ApiSpec) error { builtinTemplate: mainTemplate, data: map[string]string{ "importPackages": genMainImports(rootPkg), - "serviceName": configName, + "serviceName": configName, }, }) }