Skip to content
Snippets Groups Projects
Commit 766c2ca5 authored by cvictory's avatar cvictory
Browse files

fix review issue: use copy value

parent 9fa38960
No related branches found
No related tags found
No related merge requests found
......@@ -224,7 +224,14 @@ func WithParameterTypes(parameterTypes []reflect.Type) option {
// WithParameterTypeNames creates option with @parameterTypeNames.
func WithParameterTypeNames(parameterTypeNames []string) option {
return func(invo *RPCInvocation) {
invo.parameterTypeNames = parameterTypeNames
if len(parameterTypeNames) == 0 {
return
}
parameterTypeNamesTmp := make([]string, len(parameterTypeNames))
for k, v := range parameterTypeNames {
parameterTypeNamesTmp[k] = v
}
invo.parameterTypeNames = parameterTypeNamesTmp
}
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment