-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding the missing parameters for creating the next available Subnet in a Address block #6
Adding the missing parameters for creating the next available Subnet in a Address block #6
Conversation
…in a Address block
@@ -7,6 +7,7 @@ package address_block | |||
|
|||
import ( | |||
"context" | |||
"github.com/go-openapi/swag" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You might want to follow the existing pattern and move this one to the next block.
// query param cidr | ||
var qrCidr int32 | ||
|
||
if o.Cidr != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't this if
pointless? Same comment applies to all added parameters.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
True. But this is generated code, so I left it as is
var qrComment string | ||
|
||
if o.Comment != nil { | ||
qrComment = *o.Comment | ||
} | ||
qComment := qrComment | ||
if qComment != "" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we really need two temporary variables to handle a string?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, we don't need it. But this is generated code, so I left it as is
} | ||
} | ||
} | ||
|
||
if len(res) > 0 { | ||
return errors.CompositeValidationError(res...) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we supposed to accumulate all the errors within res
instead of bailing out on the first one?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should. But this is generated code, so I left it as is
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't know I was reviewing auto-generated code as the first line containing // Code generated by go-swagger; DO NOT EDIT.
doesn't show up in the diff.
I should have added this info |
660297e
into
infobloxopen:inheritance_sources
To support the creation of the Next Available Subnet in an Address Block. The added Params are sent in QueryParams and are used in the creation.