Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Make Ansible Operator parameter case conversion optional #3245
Make Ansible Operator parameter case conversion optional #3245
Changes from all commits
9ee732a
0071888
f2ced17
f93f24b
7798a41
8958df3
881d089
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
The issue faced in the lint is
maligned
. To solve it you can just keep the bools at the ends. Move the Selector before of them.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'm speechless at this lint check.
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.
Hi @tengqm,
For further information see: https://medium.com/@sebassegros/golang-dealing-with-maligned-structs-9b77bacf4b97
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.
@camilamacedo86 Thanks for the pointer. I didn't realize that Go is so hypercritical and nitpicking ... and I'm not sure if it is always a good thing. But anyway.
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.
Just to clarifies, the
maligned
is a lint check. It checks the usage of memory space of a structure and alert when we are using more spaces than required. Why it would be a bad thing at all?However, in the cases that we decide to prioritize the code understatement instead of it, we can just say for the lint ignore the specific check in the specific place by using
// nolint:maligned
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.
If it is always the right thing to do, the compiler should do this byte alignment transparently rather than forcing the developer to think about these details. There are other cases I want to order my fields for different purposes, e.g. semantic grouping, deriving Web UI for an input struct etc.