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

Feature request: Improve the message for case when tags are omitted in structs' field types #108

Open
Antonboom opened this issue Nov 24, 2024 · 1 comment

Comments

@Antonboom
Copy link

Antonboom commented Nov 24, 2024

it was a long journey to figure out what exactly linter was unhappy with :)

Simple example:

type AddUsersResponse struct {
	Seq     int                     `json:"seq,omitempty"`
	Succeed []int                   `json:"succeed,omitempty"`
	Errors  []AddUsersResponseError `json:"errors,omitempty"`
}

type AddUsersResponseError struct {
	ChatID int               // <----
	ErrMsg string         // <----
}

resp := new(AddUsersResponse)
json.NewEncoder(w).Encode(resp)
@Antonboom Antonboom changed the title Feature request: Improve the message for case when tags are omitted in nested structs Feature request: Improve the message for case when tags are omitted in structs' field types Nov 24, 2024
@tmzane
Copy link
Member

tmzane commented Nov 25, 2024

Yep, it's a known problem :)

We've got #89 to solve this, but I'm still not sure which implementation would be better. Suggestions are welcome!

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