Copilot commented on code in PR #3221:
URL: https://github.com/apache/dubbo-go/pull/3221#discussion_r2831746470


##########
cluster/router/options.go:
##########
@@ -93,5 +93,16 @@ func WithTags(tags []global.Tag) Option {
        return func(opts *Options) {
                opts.Router.Tags = tags
        }
+}
 
+func WithScript(script string) Option {
+       return func(opts *Options) {
+               opts.Router.Script = script
+       }
+}
+
+func WithScriptType(scriptType string) Option {
+       return func(opts *Options) {
+               opts.Router.ScriptType = scriptType
+       }
 }

Review Comment:
   Test coverage is missing for the option functions in this file. Following 
the established pattern in the codebase (such as metrics/options_test.go and 
otel/trace/options_test.go), each WithXxx function should have a corresponding 
TestWithXxx test case. Please add tests for WithRuntime, WithEnabled, 
WithScript, and WithScriptType to verify they correctly set their respective 
fields in opts.Router.



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