mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Chore: use any rather than interface{} (#74066)
This commit is contained in:
@@ -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{}
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user