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

Inconsistent struct tag use #41

Closed
lestrrat opened this issue Nov 13, 2019 · 3 comments
Closed

Inconsistent struct tag use #41

lestrrat opened this issue Nov 13, 2019 · 3 comments

Comments

@lestrrat
Copy link
Contributor

I guess the intent of this is to allow

type T struct {
    A `foo`
}

to just work, but I don't think this is a common practice (at least, encoding/json doesn't do that), and I also think it's a bad idea.

At least, the current code does not check for this:

type T struct {
    A `"foo"` // does NOT do what we want
}

of course, it's easy to handle this particular case, but it's just one more inconsistency. I think it's much much better to say "we support tag name X (and Y)" and be done with it.

@lestrrat lestrrat changed the title Inconsistent Inconsistent struct tag use Nov 13, 2019
@goccy
Copy link
Owner

goccy commented Nov 13, 2019

I implemented this behavior with reference to go-yaml/yaml ,
but I'm also wondering if this feature is needed, so I consider removing it .

@lestrrat
Copy link
Contributor Author

if the goal is to be compatible with other libraries, as long as there's a big fat warning in the code and docs, I think it's okay.

if it's up for a toss, I would say it's not necessary

@goccy
Copy link
Owner

goccy commented Nov 13, 2019

I fixed this issue with #44

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