Skip to content
This repository has been archived by the owner on Sep 18, 2019. It is now read-only.

Don't create extra flag namespaces for embedded fields #7

Merged
merged 2 commits into from
May 21, 2015
Merged

Don't create extra flag namespaces for embedded fields #7

merged 2 commits into from
May 21, 2015

Conversation

awly
Copy link
Collaborator

@awly awly commented May 21, 2015

Similar to how endoding/json handles embedded structs. This is also how
BurntSushi/toml handles them so it makes sense to have corresponding
flag names.

Sorry for the noise in tests, had to rename existing embedded to nested
to avoid confusion.

Similar to how endoding/json handles embedded structs. This is also how
BurntSushi/toml handles them so it makes sense to have corresponding
flag names.
@@ -182,6 +182,9 @@ In TOML, a struct corresponds to a nested section; in flags the name will be dot
// and this flag
-s.n=3

Embedded structs are handled similarly to encoding/json: fields of embedded
struct are treated as if they were fields of embedding struct.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wording tweaks:

Embedded structs are handled like in encoding/json: their exported fields
are treated as if they were fields of the outer struct.

@cespare
Copy link
Owner

cespare commented May 21, 2015

Nice, good find. LGTM.

awly pushed a commit that referenced this pull request May 21, 2015
Don't create extra flag namespaces for embedded fields
@awly awly merged commit 8da29a6 into cespare:master May 21, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants