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

fix: do not abort check on ignored fields #88

Merged
merged 1 commit into from
Apr 7, 2024

Conversation

22dm
Copy link
Contributor

@22dm 22dm commented Apr 6, 2024

type Nested struct {
	NoTagA string
}

type Foo struct {
	Ignored Nested `json:"-"`
	NoTagB  string
}

Such a structure should report an error because NoTagB lacks the json tag. However, it currently does not, because the misplaced return instead of continue is made in the code, which skips the check of subsequent fields.

@22dm 22dm reopened this Apr 6, 2024
@tmzane tmzane self-requested a review April 7, 2024 16:26
@tmzane
Copy link
Member

tmzane commented Apr 7, 2024

Good catch, I totally missed that 😅

Copy link
Member

@tmzane tmzane left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@tmzane tmzane changed the title fix: the subsequent fields of the ignored field are skipped fix: do not abort check on ignored fields Apr 7, 2024
@tmzane tmzane merged commit d59fd57 into go-simpler:main Apr 7, 2024
10 checks passed
@tmzane
Copy link
Member

tmzane commented Apr 7, 2024

Thanks!

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