From 823e25ed18c814ac8a464f990ed152ae0b68e261 Mon Sep 17 00:00:00 2001 From: Jan Gottschick Date: Fri, 20 Sep 2024 09:51:27 +0200 Subject: [PATCH] * fix --- core/version | 2 +- templates/core/config.go.tmpl | 4 ++-- templates/core/info.go.tmpl | 4 +++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/core/version b/core/version index 0d91a54..d15723f 100644 --- a/core/version +++ b/core/version @@ -1 +1 @@ -0.3.0 +0.3.2 diff --git a/templates/core/config.go.tmpl b/templates/core/config.go.tmpl index 0bb40f8..d8dc9b5 100644 --- a/templates/core/config.go.tmpl +++ b/templates/core/config.go.tmpl @@ -48,7 +48,7 @@ var ( ) func init() { - AppConfig.Service = stringy.New("{{.ModuleName}}").SnakeCase("?", "").ToUpper() + AppConfig.Service = service AppConfig.Host, _ = os.Hostname() AppConfig.User = os.Getenv("USER") sid, _ := uuid.NewUUID() @@ -63,7 +63,7 @@ func init() { flag.BoolVar(&AppConfig.Version, "V", AppConfig.Version, "print version") if AppConfig.Name == "" { - AppConfig.Name = AppConfig.Service + AppConfig.Name = service } if AppConfig.Title == "" { AppConfig.Title = AppConfig.Name diff --git a/templates/core/info.go.tmpl b/templates/core/info.go.tmpl index 4a122ba..15e02b7 100644 --- a/templates/core/info.go.tmpl +++ b/templates/core/info.go.tmpl @@ -6,6 +6,8 @@ import ( "strings" ) +const service = "{{.ModuleName}}" + type Info struct { Service string Name string @@ -22,5 +24,5 @@ var ( ) func init() { - AppInfo = Info{Service: "{{.ModuleName}}", Version: Version, Name: ""} + AppInfo = Info{Service: service, Version: Version, Name: ""} }