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

Do you have plans to support embed struct? #10

Open
nao50 opened this issue Aug 11, 2021 · 1 comment
Open

Do you have plans to support embed struct? #10

nao50 opened this issue Aug 11, 2021 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@nao50
Copy link

nao50 commented Aug 11, 2021

Hi! Thanks for the great library!
I would like to generate an embedded struct like the following.

type Some struct {
	str string
}

type Any struct {
	Some
}

When I generate this Any structure, I expected to write something like this

_ := generator.NewStruct("Any").AddField("", "Some")

I think the struct may be generated with the type information.
So does removing the following line fit with your idea?

if field.name == "" {
return "", errmsg.StructFieldNameIsEmptyErr(sg.fieldsCallers[i])
}

Thanks.

@moznion moznion added the enhancement New feature or request label Aug 20, 2021
@moznion moznion self-assigned this Aug 20, 2021
@moznion
Copy link
Owner

moznion commented Aug 20, 2021

It looks like a good feature proposal. I'm going to work on this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants