Replace interface{} with any

This commit is contained in:
ionutboangiu
2023-05-29 11:44:03 -04:00
committed by Dan Christian Bogos
parent 1d7bd1389b
commit 113e2a2bdf
628 changed files with 7230 additions and 7230 deletions

View File

@@ -55,7 +55,7 @@ func (eeR *ExportRequest) String() string {
}
// FieldAsInterface implements utils.DataProvider
func (eeR *ExportRequest) FieldAsInterface(fldPath []string) (val interface{}, err error) {
func (eeR *ExportRequest) FieldAsInterface(fldPath []string) (val any, err error) {
switch fldPath[0] {
default:
var dp utils.DataProvider
@@ -88,7 +88,7 @@ func (eeR *ExportRequest) FieldAsInterface(fldPath []string) (val interface{}, e
// FieldAsString implements utils.DataProvider
func (eeR *ExportRequest) FieldAsString(fldPath []string) (val string, err error) {
var iface interface{}
var iface any
if iface, err = eeR.FieldAsInterface(fldPath); err != nil {
return
}
@@ -105,7 +105,7 @@ func (eeR *ExportRequest) SetFields(ctx *context.Context, tplFlds []*config.FCTe
continue
}
var out interface{}
var out any
out, err = eeR.ParseField(tplFld)
if err != nil {
if err == utils.ErrNotFound {
@@ -167,7 +167,7 @@ func (eeR *ExportRequest) SetAsSlice(fullPath *utils.FullPath, val *utils.DataLe
// ParseField outputs the value based on the template item
func (eeR *ExportRequest) ParseField(
cfgFld *config.FCTemplate) (out interface{}, err error) {
cfgFld *config.FCTemplate) (out any, err error) {
tmpType := cfgFld.Type
switch tmpType {
case utils.MetaFiller:
@@ -215,7 +215,7 @@ func (eeR *ExportRequest) Compose(fullPath *utils.FullPath, val *utils.DataLeaf)
switch prfx := fullPath.PathSlice[0]; prfx {
case utils.MetaUCH:
path := fullPath.Path[5:]
var prv interface{}
var prv any
if prvI, ok := Cache.Get(utils.CacheUCH, path); !ok {
prv = val.Data
} else {
@@ -223,7 +223,7 @@ func (eeR *ExportRequest) Compose(fullPath *utils.FullPath, val *utils.DataLeaf)
}
return Cache.Set(context.TODO(), utils.CacheUCH, path, prv, nil, true, utils.NonTransactional)
case utils.MetaOpts:
var prv interface{}
var prv any
if prv, err = eeR.inData[utils.MetaOpts].FieldAsInterface(fullPath.PathSlice[1:]); err != nil {
if err != utils.ErrNotFound {
return