This is an automated email from the ASF dual-hosted git repository.
alexstocks pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/dubbo-go.git
The following commit(s) were added to refs/heads/develop by this push:
new 3e819307a Correct type assertion for service info in exportServices
method (#2938)
3e819307a is described below
commit 3e819307a66fce7db16687f08d117bf8901d7c9d
Author: KamTo Hung <[email protected]>
AuthorDate: Wed Jul 9 09:47:13 2025 +0800
Correct type assertion for service info in exportServices method (#2938)
* fix: Correct type assertion for service info in exportServices method
* fix: Correct typo in comment regarding method name case sensitivity
---------
Co-authored-by: marsevilspirit <[email protected]>
---
server/server.go | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/server/server.go b/server/server.go
index 1dbc97545..0d9267891 100644
--- a/server/server.go
+++ b/server/server.go
@@ -134,11 +134,10 @@ func (s *Server) genSvcOpts(handler any, opts
...ServiceOption) (*ServiceOptions
func (s *Server) exportServices() (err error) {
s.svcOptsMap.Range(func(svcOptsRaw, infoRaw any) bool {
svcOpts := svcOptsRaw.(*ServiceOptions)
- if infoRaw == nil {
+ if info, ok := infoRaw.(*common.ServiceInfo); !ok || info ==
nil {
err = svcOpts.ExportWithoutInfo()
} else {
- info := infoRaw.(*common.ServiceInfo)
- // Add a method with a name of a differtent
first-letter case
+ // Add a method with a name of a different first-letter
case
// to achieve interoperability with java
// TODO: The method name case sensitivity in Dubbo-java
should be addressed.
// We ought to make changes to handle this issue.