Chore: use any rather than interface{} (#74066)
This commit is contained in:
@@ -51,9 +51,9 @@ func notAuthorized(c *contextmodel.ReqContext) {
|
||||
|
||||
func tokenRevoked(c *contextmodel.ReqContext, err *auth.TokenRevokedError) {
|
||||
if c.IsApiRequest() {
|
||||
c.JSON(401, map[string]interface{}{
|
||||
c.JSON(401, map[string]any{
|
||||
"message": "Token revoked",
|
||||
"error": map[string]interface{}{
|
||||
"error": map[string]any{
|
||||
"id": "ERR_TOKEN_REVOKED",
|
||||
"maxConcurrentSessions": err.MaxConcurrentSessions,
|
||||
},
|
||||
|
||||
@@ -236,7 +236,7 @@ func middlewareScenario(t *testing.T, desc string, fn scenarioFunc, cbs ...func(
|
||||
}
|
||||
} else {
|
||||
t.Log("Returning JSON OK")
|
||||
resp := make(map[string]interface{})
|
||||
resp := make(map[string]any)
|
||||
resp["message"] = "OK"
|
||||
c.JSON(http.StatusOK, resp)
|
||||
}
|
||||
|
||||
@@ -152,7 +152,7 @@ func Recovery(cfg *setting.Cfg) web.Middleware {
|
||||
}
|
||||
|
||||
if ctx != nil && ctx.IsApiRequest() {
|
||||
resp := make(map[string]interface{})
|
||||
resp := make(map[string]any)
|
||||
resp["message"] = fmt.Sprintf("Internal Server Error - %s", cfg.UserFacingDefaultError)
|
||||
|
||||
if data.ErrorMsg != "" {
|
||||
|
||||
@@ -22,7 +22,7 @@ type scenarioContext struct {
|
||||
m *web.Mux
|
||||
context *contextmodel.ReqContext
|
||||
resp *httptest.ResponseRecorder
|
||||
respJson map[string]interface{}
|
||||
respJson map[string]any
|
||||
handlerFunc handlerFunc
|
||||
defaultHandler web.Handler
|
||||
url string
|
||||
|
||||
Reference in New Issue
Block a user