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

proposal: Struct tags: allow , in addition to ; #7381

Open
andig opened this issue Mar 5, 2025 · 1 comment
Open

proposal: Struct tags: allow , in addition to ; #7381

andig opened this issue Mar 5, 2025 · 1 comment
Labels
type:question general questions

Comments

@andig
Copy link

andig commented Mar 5, 2025

Looking at the docs (and found through https://stackoverflow.com/questions/79486577/cannot-serialise-map-using-serialiserjson), it seems that gorm requires structure tags to be split by ;:

type Config struct {
	Type  string
	Data  map[string]any `gorm:"value;type:string;serializer:json"`
}

This is very unusual and doesn't match idiomatic go which uses , instead. For ease of use and backward compatibility, I propose allowing both comma and semicolon as struct tag delimiters.

@github-actions github-actions bot added the type:question general questions label Mar 5, 2025
@andig
Copy link
Author

andig commented Mar 5, 2025

I would be happy to file a PR to remove this hurdle for new users.

@andig andig changed the title Struct tags: allow , instead of ; proposal: Struct tags: allow , in addition to ; Mar 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:question general questions
Projects
None yet
Development

No branches or pull requests

1 participant