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

Struct enmbeeded #11

Open
xellDart opened this issue Jan 21, 2018 · 3 comments
Open

Struct enmbeeded #11

xellDart opened this issue Jan 21, 2018 · 3 comments

Comments

@xellDart
Copy link

Is possible to get embeeded struct field for example
struct A {
Person Person
}

struct Person {
fields....
}

I need to get person fields without use direct struct

@TateDeng
Copy link

this is a common use case, hope we can support it

@oleiade
Copy link
Owner

oleiade commented Jan 11, 2023

Hey @TateDeng thanks for bringing this to my attention 🙇🏻

I'll try to find time to look into it, indeed. In the meantime, if you have ideas of how to contribute the feature yourself, feel free to open a pr 👍🏻

@TateDeng
Copy link

TateDeng commented Jan 12, 2023

Hey @TateDeng thanks for bringing this to my attention 🙇🏻

I'll try to find time to look into it, indeed. In the meantime, if you have ideas of how to contribute the feature yourself, feel free to open a pr 👍🏻

@oleiade I was thinking to support . in the name, tagValue params of all exported functions, e.g. MyEmbeddedStruct.EmbeddedField for below case, what do you think?

type MyStruct struct {
	MyEmbeddedStruct
	FirstField  string `matched:"first tag"`
	SecondField int    `matched:"second tag"`
	ThirdField  string `unmatched:"third tag"`
}

type MyEmbeddedStruct struct {
	EmbeddedField string
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants