提交 db12074a authored 作者: mooncake9527's avatar mooncake9527

nacos port

上级 6a544217
...@@ -111,7 +111,7 @@ func nacosConf() { ...@@ -111,7 +111,7 @@ func nacosConf() {
group := readEnvVarWithDefault("NACOS_GROUP", "DEFAULT_GROUP") group := readEnvVarWithDefault("NACOS_GROUP", "DEFAULT_GROUP")
username := readEnvVarWithDefault("NACOS_USERNAME", "nacos") username := readEnvVarWithDefault("NACOS_USERNAME", "nacos")
password := readEnvVarWithDefault("NACOS_PASSWORD", "123456") password := readEnvVarWithDefault("NACOS_PASSWORD", "123456")
logger.Infof("[conf]conf host:%s namespace:%s dataId:%s group:%s", host, namespace, dataID, group) logger.Infof("[conf]conf host:%s port:%s namespace:%s dataId:%s group:%s", host, port, namespace, dataID, group)
Cfg.ConfCenter.Nacos.IPs = strings.Split(host, ",") Cfg.ConfCenter.Nacos.IPs = strings.Split(host, ",")
Cfg.ConfCenter.Nacos.Port = cast.ToInt(port) Cfg.ConfCenter.Nacos.Port = cast.ToInt(port)
Cfg.ConfCenter.Nacos.Namespace = namespace Cfg.ConfCenter.Nacos.Namespace = namespace
......
package config
import "testing"
func Test_readEnvVarWithDefault(t *testing.T) {
port := readEnvVarWithDefault("NACOS_PORT", "8848")
t.Log(port)
}
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论