Skip to content
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

omitzero is not allowed #1242

Open
sbp-bvanb opened this issue Feb 19, 2025 · 4 comments
Open

omitzero is not allowed #1242

sbp-bvanb opened this issue Feb 19, 2025 · 4 comments

Comments

@sbp-bvanb
Copy link

Describe the bug
A clear and concise description of what the bug is.

Since 1.24, omitzero has been introduced.

To Reproduce
Steps to reproduce the behavior:

  1. I updated revive go install github.com/mgechev/revive@latest
  2. I run it with the following flags & configuration file:
Something          []string `json:"something,omitzero"`

struct-tag: unknown option 'omitzero' in JSON tag (revive)

# flags

revive ...
# config file

Expected behavior
A clear and concise description of what you expected to happen.

Logs
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. Ubuntu 18.04]
  • Version of Go

Additional context
Add any other context about the problem here.

@chavacava
Copy link
Collaborator

chavacava commented Feb 19, 2025

Hi @sbp-bvanb thanks for reporting the issue. Support for omitzero was added by #1238. The next release will include that enhancement.

Edit: indeed, #1238 is included in the last version. Does your .mod specify go version 1.24 ?

@chavacava chavacava reopened this Feb 19, 2025
@sbp-bvanb
Copy link
Author

@chavacava We are using golangci-lint. I did not check whether that tool uses 1.7.0 of revive under the hood.

@sbp-bvanb
Copy link
Author

It seemed to have been merged. We will have to wait for the next release of golangci-lint.

@chavacava
Copy link
Collaborator

AFAIK, The last version of golangci-lint does not include v1.7.0 of revive.

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

No branches or pull requests

2 participants