Skip to content

Allow ignore directives to contain regex - #423

Merged
klauspost merged 2 commits into
tinylib:masterfrom
klauspost:ignore-regex
Nov 21, 2025
Merged

klauspost merged 2 commits into
tinylib:masterfrom
klauspost:ignore-regex

Conversation

@klauspost

Copy link
Copy Markdown
Collaborator

Prefixing name of a an ignore directive with regex: will make it ignore all RE2 regex matches.

Examples:

//msgp:ignore regex:IGNORE

Ignore all types that contains IGNORE.

//msgp:size ignore regex:IGNORE

Do not generate Msgsize() int for all types that contains IGNORE.

Prefixing name of a an ignore directive with `regex:` will make it ignore all regex matches.
@klauspost
klauspost requested a review from philhofer November 20, 2025 11:21
Comment thread gen/spec.go Outdated
Comment thread parse/directives.go Outdated
Co-authored-by: Phil <philhofer@users.noreply.github.com>
@philhofer
philhofer self-requested a review November 20, 2025 21:12
@klauspost
klauspost merged commit 00e7bb0 into tinylib:master Nov 21, 2025
4 checks passed
@klauspost
klauspost deleted the ignore-regex branch November 21, 2025 09:22
gannett-ggreer pushed a commit to GannettDigital/msgp that referenced this pull request Aug 25, 2026
Prefixing name of a an ignore directive with `regex:` will make it ignore all RE2 regex matches.

Examples:

```
//msgp:ignore regex:IGNORE
```
Ignore all types that contains `IGNORE`.

```
//msgp:size ignore regex:IGNORE
```
Do not generate `Msgsize() int` for all types that contains IGNORE.

Co-authored-by: Phil <philhofer@users.noreply.github.com>

---------

Co-authored-by: Phil <philhofer@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants