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

This commit is contained in:
Ryan McKinley
2023-08-30 18:46:47 +03:00
committed by GitHub
parent 3e272d2bda
commit 025b2f3011
525 changed files with 2528 additions and 2528 deletions
@@ -22,7 +22,7 @@ func CustomQueryParameters(logger log.Logger) sdkhttpclient.Middleware {
return next
}
data, ok := grafanaData.(map[string]interface{})
data, ok := grafanaData.(map[string]any)
if !ok {
return next
}
@@ -42,7 +42,7 @@ func TestCustomQueryParametersMiddleware(t *testing.T) {
t.Run("Without custom query parameters set as string should not apply middleware", func(t *testing.T) {
mw := CustomQueryParameters(log.New("test"))
rt := mw.CreateMiddleware(httpclient.Options{
CustomOptions: map[string]interface{}{
CustomOptions: map[string]any{
customQueryParametersKey: 64,
},
}, finalRoundTripper)
@@ -66,7 +66,7 @@ func TestCustomQueryParametersMiddleware(t *testing.T) {
t.Run("With custom query parameters set as empty string should not apply middleware", func(t *testing.T) {
mw := CustomQueryParameters(log.New("test"))
rt := mw.CreateMiddleware(httpclient.Options{
CustomOptions: map[string]interface{}{
CustomOptions: map[string]any{
customQueryParametersKey: "",
},
}, finalRoundTripper)
@@ -90,7 +90,7 @@ func TestCustomQueryParametersMiddleware(t *testing.T) {
t.Run("With custom query parameters set as invalid query string should not apply middleware", func(t *testing.T) {
mw := CustomQueryParameters(log.New("test"))
rt := mw.CreateMiddleware(httpclient.Options{
CustomOptions: map[string]interface{}{
CustomOptions: map[string]any{
customQueryParametersKey: "custom=%%abc&test=abc",
},
}, finalRoundTripper)
@@ -114,8 +114,8 @@ func TestCustomQueryParametersMiddleware(t *testing.T) {
t.Run("With custom query parameters set should apply middleware for request URL containing query parameters ", func(t *testing.T) {
mw := CustomQueryParameters(log.New("test"))
rt := mw.CreateMiddleware(httpclient.Options{
CustomOptions: map[string]interface{}{
grafanaDataKey: map[string]interface{}{
CustomOptions: map[string]any{
grafanaDataKey: map[string]any{
customQueryParametersKey: "custom=par/am&second=f oo",
},
},
@@ -146,8 +146,8 @@ func TestCustomQueryParametersMiddleware(t *testing.T) {
t.Run("With custom query parameters set should apply middleware for request URL not containing query parameters", func(t *testing.T) {
mw := CustomQueryParameters(log.New("test"))
rt := mw.CreateMiddleware(httpclient.Options{
CustomOptions: map[string]interface{}{
grafanaDataKey: map[string]interface{}{
CustomOptions: map[string]any{
grafanaDataKey: map[string]any{
customQueryParametersKey: "custom=par/am&second=f oo",
},
},