func propagateCommonFieldsInStruct()

in internal/satellite/config/loader.go [93:108]


func propagateCommonFieldsInStruct(cfg interface{}, commonFields *config.CommonFields) {
	v := reflect.ValueOf(cfg)
	if v.Kind() == reflect.Ptr {
		v = v.Elem()
	}
	for i := 0; i < v.Type().NumField(); i++ {
		fieldVal := v.Field(i).Interface()
		if arr, ok := fieldVal.([]plugin.Config); arr != nil && ok {
			for _, pc := range arr {
				propagateCommonFields(pc, commonFields)
			}
		} else if pc, ok := fieldVal.(plugin.Config); pc != nil && ok {
			propagateCommonFields(pc, commonFields)
		}
	}
}