Improve and simplify generation of fields#10168
Conversation
1e96b99 to
9a9d5c0
Compare
libbeat/asset/asset.go
Outdated
There was a problem hiding this comment.
Why using camel cased names here?
There was a problem hiding this comment.
This is to better match with the naming scheme of Go functions, like FieldsYml as an example.
There was a problem hiding this comment.
@ruflin This might not be necessary in this PR because it's applied to a different value than before. IIRC previously this was being used to camel case the generated Go function name like AssetFileIntegrity() rather than AssetFile_integrity(). And now it appears to be mutating the source file name that's referenced in the generated code.
There was a problem hiding this comment.
@andrewkroh It will be the case in a follow up PR. I just copied it over from there and is the reason it does not look optimal here. The more important point of this PR is bringing it into one place so will make it look good for this PR and can then still adjust it in the follow up PR.
|
@jsoriano @andrewkroh I updated this PR again to also include the support for multiple assets per package even though it's not needed yet and only in the follow up PR. I did it here to have fewer changes in the follow up PR. The paths and names in some of the files are not optimal but work. I suggest to leave it like this for now as all these will change again with #9507 |
There was a problem hiding this comment.
Ugh, that is ugly. need to fix this.
Introduce method that all Method names start same way. Unify asset generation to remove duplicated code.
Introduce method that all Method names start same way. Unify asset generation to remove duplicated code.
Introduce method that all Method names start same way. Unify asset generation to remove duplicated code.