go-simpler / musttag

🚔 Enforce field tags in (un)marshaled structs
https://go-simpler.org/musttag
Mozilla Public License 2.0
36 stars 9 forks source link

fix: do not abort check on ignored fields #88

Closed 22dm closed 7 months ago

22dm commented 7 months ago
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.

tmzane commented 7 months ago

Good catch, I totally missed that 😅

tmzane commented 7 months ago

Thanks!