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:
Karsten Weiss
2018-04-28 10:53:16 +02:00
parent c5419ba885
commit 893a91af3a
8 changed files with 125 additions and 132 deletions
+2 -4
View File
@@ -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)