You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by "Alanxtl (via GitHub)" <gi...@apache.org> on 2026/05/12 04:46:56 UTC

[I] [Refactor] 统一配置库为 koanf,移除 viper 依赖 [dubbo-go]

Alanxtl opened a new issue, #3322:
URL: https://github.com/apache/dubbo-go/issues/3322

   ### ✅ 验证清单
   
   - [x] 🔍 我已经搜索过 [现有 Issues](https://github.com/apache/dubbo-go/issues),确信这不是重复请求
   - [x] 📋 我已经查看了 [发布说明](https://github.com/apache/dubbo-go/releases),确信此功能尚未实现
   
   ### 🎯 功能描述
   
   当前仓库内同时存在 `viper` 和 `koanf` 两套配置处理方案,配置相关逻辑分散在不同模块中,增加了维护成本,也让配置读取、解析和测试路径不够统一。
   从代码现状看,主配置链路已经大量使用 koanf,但仓库里仍有部分模块、工具和模板继续依赖 `viper`,导致配置方案不一致。
   
   将仓库中的配置处理统一迁移到 `koanf`,尽量移除 `viper` 的直接依赖和使用。
   
   ### 📋 使用场景
   
   梳理仓库中所有 `viper` 的使用点
   将可替换的配置读取逻辑迁移到 `koanf`
   调整相关测试、示例和模板代码
   更新 `go.mod` / `go.sum`,移除不再需要的 `viper` 依赖
   确保现有配置行为保持兼容,或明确记录不兼容变更
   
   ### ⚖️ 复杂性与风险评估
   
   _No response_
   
   ### 🔗 外部依赖
   
   _No response_
   
   ### 📚 附加信息
   
   _No response_


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


Re: [I] [Refactor] 统一配置库为 koanf,移除 viper 依赖 [dubbo-go]

Posted by "nagisa-kunhah (via GitHub)" <gi...@apache.org>.
nagisa-kunhah commented on issue #3322:
URL: https://github.com/apache/dubbo-go/issues/3322#issuecomment-4427514429

   hello, can assign it to me?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


Re: [I] [Refactor] 统一配置库为 koanf,移除 viper 依赖 [dubbo-go]

Posted by "Alanxtl (via GitHub)" <gi...@apache.org>.
Alanxtl commented on issue #3322:
URL: https://github.com/apache/dubbo-go/issues/3322#issuecomment-4427626825

   > hello, can assign it to me?
   
   of course


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


Re: [I] [Refactor] 统一配置库为 koanf,移除 viper 依赖 [dubbo-go]

Posted by "nagisa-kunhah (via GitHub)" <gi...@apache.org>.
nagisa-kunhah commented on issue #3322:
URL: https://github.com/apache/dubbo-go/issues/3322#issuecomment-4436887522

   @Alanxtl Hello,这边看了下代码,目前代码里有用到viper的主要是tools/dubbogo-cli和Apollo的测试代码里:
   1. dubbogo-cli 里原来通过 viper 尝试读取 CLI 自己的配置文件,但实际代码里没有使用 viper.Get*、Unmarshal、BindPFlag 等读取配置值的逻辑,只是在成功读取配置文件后打印 Using configfile: ...,对实际流程没有影响,而且已经被标记为deprecated了。**这里可以替换为koanf,但这段代码实际没有用处,可否考虑直接删除?**
   2. config_center/apollo/impl_test.go这个测试会用到viper进行解析,向上层返回map。**这里直接替换成koanf应该也可以。**


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


Re: [I] [Refactor] 统一配置库为 koanf,移除 viper 依赖 [dubbo-go]

Posted by "Alanxtl (via GitHub)" <gi...@apache.org>.
Alanxtl commented on issue #3322:
URL: https://github.com/apache/dubbo-go/issues/3322#issuecomment-4456981711

   close via #3323


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


Re: [I] [Refactor] 统一配置库为 koanf,移除 viper 依赖 [dubbo-go]

Posted by "Alanxtl (via GitHub)" <gi...@apache.org>.
Alanxtl closed issue #3322: [Refactor] 统一配置库为 koanf,移除 viper 依赖
URL: https://github.com/apache/dubbo-go/issues/3322


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


Re: [I] [Refactor] 统一配置库为 koanf,移除 viper 依赖 [dubbo-go]

Posted by "Alanxtl (via GitHub)" <gi...@apache.org>.
Alanxtl commented on issue #3322:
URL: https://github.com/apache/dubbo-go/issues/3322#issuecomment-4436932148

   > [@Alanxtl](https://github.com/Alanxtl) Hello,这边看了下代码,目前代码里有用到viper的主要是tools/dubbogo-cli和Apollo的测试代码里:
   > 
   > 1. dubbogo-cli 里原来通过 viper 尝试读取 CLI 自己的配置文件,但实际代码里没有使用 viper.Get*、Unmarshal、BindPFlag 等读取配置值的逻辑,只是在成功读取配置文件后打印 Using configfile: ...,对实际流程没有影响,而且已经被标记为deprecated了。**这里可以替换为koanf,但这段代码实际没有用处,可否考虑直接删除?**
   > 2. config_center/apollo/impl_test.go这个测试会用到viper进行解析,向上层返回map。**这里直接替换成koanf应该也可以。**
   
   There is no need to update dubbogo-cli as it has indeed been deprecated.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org