You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 27, 2022. It is now read-only.
The doc says that you can use anonymous sub-structures, and the example implies that when the flag name is generated, the sub-structure is "squashed" (see --db.ip in the example).
I have a case that demonstrates a bug in the generation of the flag name, when an anonymous sub-structure follows a named sub-structure.
This configuration:
type EmbeddedConfig struct {
P2 int `description:"p2"`
}
type Config struct{
P1 int `description:"p1"`
EmbeddedConfig
}
If you swap the members of Config (P1 after the anonymous EmbeddedConfig), the flags are generated correctly
Attached is a source file that shows this behaviour.
The doc says that you can use anonymous sub-structures, and the example implies that when the flag name is generated, the sub-structure is "squashed" (see --db.ip in the example).
I have a case that demonstrates a bug in the generation of the flag name, when an anonymous sub-structure follows a named sub-structure.
This configuration:
generates the following flags:
The second flag should be --p2, not --p1.p2
If you swap the members of Config (P1 after the anonymous EmbeddedConfig), the flags are generated correctly
Attached is a source file that shows this behaviour.
flaeg_test.go.zip
The text was updated successfully, but these errors were encountered: