Chore: use any rather than interface{} (#74066)
This commit is contained in:
@@ -106,8 +106,8 @@ type AlertTestResult struct {
|
||||
}
|
||||
|
||||
type AlertTestResultLog struct {
|
||||
Message string `json:"message"`
|
||||
Data interface{} `json:"data"`
|
||||
Message string `json:"message"`
|
||||
Data any `json:"data"`
|
||||
}
|
||||
|
||||
type EvalMatch struct {
|
||||
|
||||
@@ -40,8 +40,8 @@ type MassDeleteAnnotationsCmd struct {
|
||||
}
|
||||
|
||||
type PostGraphiteAnnotationsCmd struct {
|
||||
When int64 `json:"when"`
|
||||
What string `json:"what"`
|
||||
Data string `json:"data"`
|
||||
Tags interface{} `json:"tags"`
|
||||
When int64 `json:"when"`
|
||||
What string `json:"what"`
|
||||
Data string `json:"data"`
|
||||
Tags any `json:"tags"`
|
||||
}
|
||||
|
||||
@@ -209,13 +209,13 @@ type FrontendSettingsDTO struct {
|
||||
Reporting FrontendSettingsReportingDTO `json:"reporting"`
|
||||
UnifiedAlertingEnabled bool `json:"unifiedAlertingEnabled"`
|
||||
UnifiedAlerting FrontendSettingsUnifiedAlertingDTO `json:"unifiedAlerting"`
|
||||
Oauth map[string]interface{} `json:"oauth"`
|
||||
Oauth map[string]any `json:"oauth"`
|
||||
SamlEnabled bool `json:"samlEnabled"`
|
||||
SamlName string `json:"samlName"`
|
||||
TokenExpirationDayLimit int `json:"tokenExpirationDayLimit"`
|
||||
|
||||
GeomapDefaultBaseLayerConfig *map[string]interface{} `json:"geomapDefaultBaseLayerConfig,omitempty"`
|
||||
GeomapDisableCustomBaseLayer bool `json:"geomapDisableCustomBaseLayer"`
|
||||
GeomapDefaultBaseLayerConfig *map[string]any `json:"geomapDefaultBaseLayerConfig,omitempty"`
|
||||
GeomapDisableCustomBaseLayer bool `json:"geomapDisableCustomBaseLayer"`
|
||||
|
||||
PublicDashboardAccessToken string `json:"publicDashboardAccessToken"`
|
||||
|
||||
|
||||
+10
-10
@@ -21,20 +21,20 @@ func TestGetUniqueDatasourceTypes(t *testing.T) {
|
||||
desc: "can get unique datasource names",
|
||||
result: []string{"mysql", "prometheus"},
|
||||
queries: []*simplejson.Json{
|
||||
simplejson.NewFromAny(map[string]interface{}{
|
||||
"datasource": map[string]interface{}{
|
||||
simplejson.NewFromAny(map[string]any{
|
||||
"datasource": map[string]any{
|
||||
"type": "prometheus",
|
||||
"uid": "uid1",
|
||||
},
|
||||
}),
|
||||
simplejson.NewFromAny(map[string]interface{}{
|
||||
"datasource": map[string]interface{}{
|
||||
simplejson.NewFromAny(map[string]any{
|
||||
"datasource": map[string]any{
|
||||
"type": "prometheus",
|
||||
"uid": "uid2",
|
||||
},
|
||||
}),
|
||||
simplejson.NewFromAny(map[string]interface{}{
|
||||
"datasource": map[string]interface{}{
|
||||
simplejson.NewFromAny(map[string]any{
|
||||
"datasource": map[string]any{
|
||||
"type": "mysql",
|
||||
"uid": "uid3",
|
||||
},
|
||||
@@ -45,13 +45,13 @@ func TestGetUniqueDatasourceTypes(t *testing.T) {
|
||||
desc: "returns empty slice when datasources have no type property",
|
||||
result: []string{},
|
||||
queries: []*simplejson.Json{
|
||||
simplejson.NewFromAny(map[string]interface{}{
|
||||
"datasource": map[string]interface{}{
|
||||
simplejson.NewFromAny(map[string]any{
|
||||
"datasource": map[string]any{
|
||||
"uid": "uid1",
|
||||
},
|
||||
}),
|
||||
simplejson.NewFromAny(map[string]interface{}{
|
||||
"datasource": map[string]interface{}{
|
||||
simplejson.NewFromAny(map[string]any{
|
||||
"datasource": map[string]any{
|
||||
"uid": "uid3",
|
||||
},
|
||||
}),
|
||||
|
||||
+13
-13
@@ -6,19 +6,19 @@ import (
|
||||
)
|
||||
|
||||
type PluginSetting struct {
|
||||
Name string `json:"name"`
|
||||
Type string `json:"type"`
|
||||
Id string `json:"id"`
|
||||
Enabled bool `json:"enabled"`
|
||||
Pinned bool `json:"pinned"`
|
||||
Module string `json:"module"`
|
||||
BaseUrl string `json:"baseUrl"`
|
||||
Info plugins.Info `json:"info"`
|
||||
Includes []*plugins.Includes `json:"includes"`
|
||||
Dependencies plugins.Dependencies `json:"dependencies"`
|
||||
JsonData map[string]interface{} `json:"jsonData"`
|
||||
SecureJsonFields map[string]bool `json:"secureJsonFields"`
|
||||
DefaultNavUrl string `json:"defaultNavUrl"`
|
||||
Name string `json:"name"`
|
||||
Type string `json:"type"`
|
||||
Id string `json:"id"`
|
||||
Enabled bool `json:"enabled"`
|
||||
Pinned bool `json:"pinned"`
|
||||
Module string `json:"module"`
|
||||
BaseUrl string `json:"baseUrl"`
|
||||
Info plugins.Info `json:"info"`
|
||||
Includes []*plugins.Includes `json:"includes"`
|
||||
Dependencies plugins.Dependencies `json:"dependencies"`
|
||||
JsonData map[string]any `json:"jsonData"`
|
||||
SecureJsonFields map[string]bool `json:"secureJsonFields"`
|
||||
DefaultNavUrl string `json:"defaultNavUrl"`
|
||||
|
||||
LatestVersion string `json:"latestVersion"`
|
||||
HasUpdate bool `json:"hasUpdate"`
|
||||
|
||||
Reference in New Issue
Block a user