Fix: dont generate pointer for dest for Generic flag
This commit is contained in:
@@ -17,7 +17,7 @@ type {{.TypeName}} struct {
|
||||
HasBeenSet bool
|
||||
|
||||
Value {{if .ValuePointer}}*{{end}}{{.GoType}}
|
||||
Destination *{{.GoType}}
|
||||
Destination {{if .NoDestinationPointer}}{{else}}*{{end}}{{.GoType}}
|
||||
|
||||
Aliases []string
|
||||
EnvVars []string
|
||||
|
@@ -223,10 +223,11 @@ func (gfs *Spec) SortedFlagTypes() []*FlagType {
|
||||
}
|
||||
|
||||
type FlagTypeConfig struct {
|
||||
SkipInterfaces []string `yaml:"skip_interfaces"`
|
||||
StructFields []*FlagStructField `yaml:"struct_fields"`
|
||||
TypeName string `yaml:"type_name"`
|
||||
ValuePointer bool `yaml:"value_pointer"`
|
||||
SkipInterfaces []string `yaml:"skip_interfaces"`
|
||||
StructFields []*FlagStructField `yaml:"struct_fields"`
|
||||
TypeName string `yaml:"type_name"`
|
||||
ValuePointer bool `yaml:"value_pointer"`
|
||||
NoDestinationPointer bool `yaml:"no_destination_pointer"`
|
||||
}
|
||||
|
||||
type FlagStructField struct {
|
||||
@@ -256,6 +257,14 @@ func (ft *FlagType) ValuePointer() bool {
|
||||
return ft.Config.ValuePointer
|
||||
}
|
||||
|
||||
func (ft *FlagType) NoDestinationPointer() bool {
|
||||
if ft.Config == nil {
|
||||
return false
|
||||
}
|
||||
|
||||
return ft.Config.NoDestinationPointer
|
||||
}
|
||||
|
||||
func (ft *FlagType) TypeName() string {
|
||||
return TypeName(ft.GoType, ft.Config)
|
||||
}
|
||||
|
Reference in New Issue
Block a user