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

allows for named structs to be included in reflection #94

Merged
merged 1 commit into from
Aug 9, 2018

Conversation

qhenkart
Copy link
Contributor

@qhenkart qhenkart commented Aug 9, 2018

type Sample struct {...}

type EmbedSample struct {
	Sample
}

I see no reason why an embedded struct is supported but a named struct is ignored. I've updated the code so that

type EmbedSample struct {
	Named Sample
}

will be included when encoding a csv

@pikanezi pikanezi merged commit b8c38cb into gocarina:master Aug 9, 2018
@tomsisk tomsisk mentioned this pull request Mar 6, 2019
@graywolf336
Copy link

@qhenkart and @pikanezi can we revert a portion of this or add some functionality back? With this change ignoring structs is no longer possible. See #107

@qhenkart
Copy link
Contributor Author

qhenkart commented Feb 21, 2020

^^ this PR did not cause the issue. It only included named struct values into the CSV value. The struct gray wolf is using happens to only contain named values, but if it contained anonymous values, it will function the same even with this PR.

The functionality that gray wolf is protesting is defined as working correctly judging from this test https://github.com/gocarina/gocsv/blob/master/encode_test.go#L268

I have included a new PR that resolves the user issue, however I believe it to be a breaking change #152

for the record, I agree with gray wolf that a csv:"-" should have its children ignored as well

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

Successfully merging this pull request may close these issues.

None yet

3 participants