docs: note that exhaustruct
struct regular expressions are expected to match the entire package/name/structname
#4190
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.
Quick one that tripped me up recently.
With the
exhaustruct
linter - the list of structs toinclude/exclude
must match the fullpackage/name/structname
- otherwise no match will be made/considered.E.g. if I wish to target a struct of:
These will work:
This won't work:
The source for
exhauststruct
helps explain this behaviour: https://github.com/GaijinEntertainment/go-exhaustruct/blob/917096e5c081c98cd2bba5ecac3d3fa1479a6029/internal/pattern/list.go#L39-L47Hopefully this comment helps in that usage!