This is an automated email from the ASF dual-hosted git repository. albumenj pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/dubbo-go.git
The following commit(s) were added to refs/heads/main by this push: new 7d254c5ca fix, set default application name if it's empty (#2518) 7d254c5ca is described below commit 7d254c5ca57ed3ecc99e3bcada1e524d20266511 Author: Ken Liu <ken.lj...@gmail.com> AuthorDate: Wed Nov 22 13:59:12 2023 +0800 fix, set default application name if it's empty (#2518) --- common/constant/env.go | 1 + config/application_config.go | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/common/constant/env.go b/common/constant/env.go index b5e4acaff..55283efc7 100644 --- a/common/constant/env.go +++ b/common/constant/env.go @@ -19,6 +19,7 @@ package constant // nolint const ( + DefaultDubboApp = "dubbo.io" ConfigFileEnvKey = "DUBBO_GO_CONFIG_PATH" // key of environment variable dubbogo configure file path AppLogConfFile = "AppLogConfFile" PodNameEnvKey = "POD_NAME" diff --git a/config/application_config.go b/config/application_config.go index 5bbdbdd3e..6bdf837e4 100644 --- a/config/application_config.go +++ b/config/application_config.go @@ -19,7 +19,6 @@ package config import ( "github.com/creasty/defaults" - "github.com/pkg/errors" ) @@ -54,6 +53,9 @@ func (ac *ApplicationConfig) Init() error { if err := ac.check(); err != nil { return err } + if ac.Name == "" { + ac.Name = constant.DefaultDubboApp + } return nil }