@@ -144,7 +144,7 @@ func (c *Config) OutputDirDepth() int {
144144// name = "fkey_name"
145145// local = "x"
146146// foreign = "y"
147- func ConvertAliases (i interface {} ) (a Aliases ) {
147+ func ConvertAliases (i any ) (a Aliases ) {
148148 if i == nil {
149149 return a
150150 }
@@ -153,7 +153,7 @@ func ConvertAliases(i interface{}) (a Aliases) {
153153
154154 tablesIntf := topLevel ["tables" ]
155155
156- iterateMapOrSlice (tablesIntf , func (name string , tIntf interface {} ) {
156+ iterateMapOrSlice (tablesIntf , func (name string , tIntf any ) {
157157 if a .Tables == nil {
158158 a .Tables = make (map [string ]TableAlias )
159159 }
@@ -178,10 +178,10 @@ func ConvertAliases(i interface{}) (a Aliases) {
178178 if colsIntf , ok := t ["columns" ]; ok {
179179 ta .Columns = make (map [string ]string )
180180
181- iterateMapOrSlice (colsIntf , func (name string , colIntf interface {} ) {
181+ iterateMapOrSlice (colsIntf , func (name string , colIntf any ) {
182182 var alias string
183183 switch col := colIntf .(type ) {
184- case map [string ]interface {} , map [interface {}] interface {} :
184+ case map [string ]any , map [any ] any :
185185 cmap := cast .ToStringMap (colIntf )
186186 alias = cmap ["alias" ].(string )
187187 case string :
@@ -193,7 +193,7 @@ func ConvertAliases(i interface{}) (a Aliases) {
193193
194194 relationshipsIntf , ok := t ["relationships" ]
195195 if ok {
196- iterateMapOrSlice (relationshipsIntf , func (name string , rIntf interface {} ) {
196+ iterateMapOrSlice (relationshipsIntf , func (name string , rIntf any ) {
197197 if ta .Relationships == nil {
198198 ta .Relationships = make (map [string ]RelationshipAlias )
199199 }
@@ -218,14 +218,14 @@ func ConvertAliases(i interface{}) (a Aliases) {
218218 return a
219219}
220220
221- func iterateMapOrSlice (mapOrSlice interface {} , fn func (name string , obj interface {} )) {
221+ func iterateMapOrSlice (mapOrSlice any , fn func (name string , obj any )) {
222222 switch t := mapOrSlice .(type ) {
223- case map [string ]interface {} , map [interface {}] interface {} :
223+ case map [string ]any , map [any ] any :
224224 tmap := cast .ToStringMap (mapOrSlice )
225225 for name , table := range tmap {
226226 fn (name , table )
227227 }
228- case []interface {} :
228+ case []any :
229229 for _ , intf := range t {
230230 obj := cast .ToStringMap (intf )
231231 name := obj ["name" ].(string )
@@ -235,12 +235,12 @@ func iterateMapOrSlice(mapOrSlice interface{}, fn func(name string, obj interfac
235235}
236236
237237// ConvertTypeReplace is necessary because viper
238- func ConvertTypeReplace (i interface {} ) []TypeReplace {
238+ func ConvertTypeReplace (i any ) []TypeReplace {
239239 if i == nil {
240240 return nil
241241 }
242242
243- intfArray := i .([]interface {} )
243+ intfArray := i .([]any )
244244 var replaces []TypeReplace
245245 for _ , r := range intfArray {
246246 replaceIntf := cast .ToStringMap (r )
@@ -270,7 +270,7 @@ func ConvertTypeReplace(i interface{}) []TypeReplace {
270270 return replaces
271271}
272272
273- func tablesOfTypeReplace (i interface {} ) []string {
273+ func tablesOfTypeReplace (i any ) []string {
274274 tables := []string {}
275275
276276 m := cast .ToStringMap (i )
@@ -281,7 +281,7 @@ func tablesOfTypeReplace(i interface{}) []string {
281281 return tables
282282}
283283
284- func columnFromInterface (i interface {} ) (col drivers.Column ) {
284+ func columnFromInterface (i any ) (col drivers.Column ) {
285285 m := cast .ToStringMap (i )
286286 if s := m ["name" ]; s != nil {
287287 col .Name = s .(string )
@@ -335,12 +335,12 @@ func columnFromInterface(i interface{}) (col drivers.Column) {
335335// column = "column_name"
336336// foreign_table = "foreign_table_name"
337337// foreign_column = "foreign_column_name"
338- func ConvertForeignKeys (i interface {} ) (fks []drivers.ForeignKey ) {
338+ func ConvertForeignKeys (i any ) (fks []drivers.ForeignKey ) {
339339 if i == nil {
340340 return nil
341341 }
342342
343- iterateMapOrSlice (i , func (name string , obj interface {} ) {
343+ iterateMapOrSlice (i , func (name string , obj any ) {
344344 t := cast .ToStringMap (obj )
345345
346346 fk := drivers.ForeignKey {
@@ -392,4 +392,4 @@ func validateDuplicateForeignKeys(fks []drivers.ForeignKey) error {
392392 fkMap [key ] = fk
393393 }
394394 return nil
395- }
395+ }
0 commit comments