@@ -69,12 +69,6 @@ func WithSkipFields(fields []string) TableOptions {
6969 }
7070}
7171
72- func WithOverrideColumns (columns []ColumnDefinition ) TableOptions {
73- return func (t * TableDefinition ) {
74- t .overrideColumns = columns
75- }
76- }
77-
7872func WithExtraColumns (columns []ColumnDefinition ) TableOptions {
7973 return func (t * TableDefinition ) {
8074 t .extraColumns = columns
@@ -122,15 +116,7 @@ func NewTableFromStruct(name string, obj interface{}, opts ...TableOptions) (*Ta
122116 comments = readStructComments (e .Type ().PkgPath (), e .Type ().Name ())
123117 }
124118
125- for _ , c := range t .extraColumns {
126- if t .overrideColumns != nil {
127- if col := t .overrideColumns .GetByName (c .Name ); col != nil {
128- t .Columns = append (t .Columns , * col )
129- continue
130- }
131- }
132- t .Columns = append (t .Columns , c )
133- }
119+ t .Columns = append (t .Columns , t .extraColumns ... )
134120
135121 for i := 0 ; i < e .NumField (); i ++ {
136122 field := e .Type ().Field (i )
@@ -144,13 +130,6 @@ func NewTableFromStruct(name string, obj interface{}, opts ...TableOptions) (*Ta
144130 continue
145131 }
146132
147- if t .overrideColumns != nil {
148- if col := t .overrideColumns .GetByName (t .nameTransformer (field .Name )); col != nil {
149- t .Columns = append (t .Columns , * col )
150- continue
151- }
152- }
153-
154133 columnType , err := valueToSchemaType (field .Type )
155134 if err != nil {
156135 fmt .Printf ("skipping field %s, got err: %v\n " , field .Name , err )
0 commit comments