Mulavar commented on a change in pull request #1425:
URL: https://github.com/apache/dubbo-go/pull/1425#discussion_r699851873



##########
File path: config/protocol_config.go
##########
@@ -27,9 +27,10 @@ import (
 
 // ProtocolConfig is protocol configuration
 type ProtocolConfig struct {
-       Name string `default:"dubbo" validate:"required" yaml:"name" 
json:"name,omitempty" property:"name"`
-       Ip   string `yaml:"ip"  json:"ip,omitempty" property:"ip"`
-       Port string `default:"2000" yaml:"port" json:"port,omitempty" 
property:"port"`
+       Name   string      `default:"dubbo" validate:"required" yaml:"name" 
json:"name,omitempty" property:"name"`
+       Ip     string      `yaml:"ip"  json:"ip,omitempty" property:"ip"`
+       Port   string      `default:"2000" yaml:"port" json:"port,omitempty" 
property:"port"`
+       Params interface{} `yaml:"params" json:"params,omitempty" 
property:"params"`

Review comment:
       
这地方我有想过用map还是interface,选interface是因为用map,value的类型用string,在后续需要作很多额外的类型强转工作,如果用interface可以直接做到默认值的方式(见下面comment的讨论),用map相对来说没有什么优势(或许可读性是优势,但考虑到如getty有专门的结构体去表示这部分参数,可读性也不差)。




-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to