Use opportunities to unindent code (unindent)
This commit fixes the following unindent findings:
pkg/api/common.go:102:2: "if x { if y" should be "if x && y"
pkg/components/dynmap/dynmap.go:642:2: invert condition and early return
pkg/components/dynmap/dynmap.go:681:2: invert condition and early return
pkg/components/simplejson/simplejson.go:171:2: "if x { if y" should be "if x && y"
pkg/middleware/dashboard_redirect.go:42:3: invert condition and early return
pkg/tsdb/mssql/mssql.go:301:3: invert condition and early break
pkg/tsdb/mysql/mysql.go:312:3: invert condition and early break
pkg/tsdb/postgres/postgres.go:292:3: invert condition and early break
pkg/tsdb/sql_engine.go:144:2: invert condition and early return
This commit is contained in:
+2
-4
@@ -99,10 +99,8 @@ func Error(status int, message string, err error) *NormalResponse {
|
||||
data["message"] = message
|
||||
}
|
||||
|
||||
if err != nil {
|
||||
if setting.Env != setting.PROD {
|
||||
data["error"] = err.Error()
|
||||
}
|
||||
if err != nil && setting.Env != setting.PROD {
|
||||
data["error"] = err.Error()
|
||||
}
|
||||
|
||||
resp := JSON(status, data)
|
||||
|
||||
Reference in New Issue
Block a user