chickenlj commented on code in PR #2445:
URL: https://github.com/apache/dubbo-go/pull/2445#discussion_r1355968128


##########
protocol/options.go:
##########
@@ -27,12 +28,30 @@ import (
 
 type Options struct {
        Protocol *global.ProtocolConfig
+
+       ID string
 }
 
-func DefaultOptions() *Options {
+func defaultOptions() *Options {
        return &Options{Protocol: global.DefaultProtocolConfig()}
 }
 
+func NewOptions(opts ...Option) *Options {
+       defOpts := defaultOptions()
+       for _, opt := range opts {
+               opt(defOpts)
+       }
+
+       if defOpts.Protocol.Name == "" {
+               panic(fmt.Sprintf("Please specify registry, eg. WithTriple()"))

Review Comment:
   Should we default to 'triple' protocol if the protocol name is not present?
   
   So, this raises another question, what's the current default behavior if 
users do not specify any information about the protocol at all? 
   
   `server.NewServer()`



-- 
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