Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # 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
Labels
enhancement New feature or request

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!

@tmzane tmzane added the enhancement New feature or request label Feb 4, 2025
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants