Chore: use any rather than interface{} (#74066)

This commit is contained in:
Ryan McKinley
2023-08-30 08:46:47 -07:00
committed by GitHub
parent 3e272d2bda
commit 025b2f3011
525 changed files with 2528 additions and 2528 deletions

View File

@@ -6,8 +6,8 @@ import (
"github.com/grafana/grafana/pkg/services/authn"
)
func (s *Service) getUsageStats(ctx context.Context) (map[string]interface{}, error) {
m := map[string]interface{}{}
func (s *Service) getUsageStats(ctx context.Context) (map[string]any, error) {
m := map[string]any{}
// Add stats about auth configuration
authTypes := map[string]bool{}

View File

@@ -12,7 +12,7 @@ import (
func TestService_getUsageStats(t *testing.T) {
svc := setupTests(t, func(svc *Service) {
svc.RegisterClient(
&authntest.FakeClient{ExpectedErr: nil, ExpectedName: "test", ExpectedPriority: 1, ExpectedStats: map[string]interface{}{"stats.test.enabled.count": 1}})
&authntest.FakeClient{ExpectedErr: nil, ExpectedName: "test", ExpectedPriority: 1, ExpectedStats: map[string]any{"stats.test.enabled.count": 1}})
svc.RegisterClient(
&authntest.FakeClient{ExpectedErr: errCantAuthenticateReq, ExpectedName: "failing", ExpectedPriority: 1, ExpectedStats: nil})
})
@@ -28,7 +28,7 @@ func TestService_getUsageStats(t *testing.T) {
got, err := svc.getUsageStats(context.Background())
require.NoError(t, err)
want := map[string]interface{}{"stats.auth_enabled.anonymous.count": 0,
want := map[string]any{"stats.auth_enabled.anonymous.count": 0,
"stats.auth_enabled.auth_proxy.count": 1,
"stats.auth_enabled.basic_auth.count": 1,
"stats.auth_enabled.grafana_password.count": 1,