From 1359f7f3918befd2463103379d17bd2eb846654d Mon Sep 17 00:00:00 2001 From: Corey Hulen Date: Thu, 9 Feb 2017 13:39:15 -0800 Subject: Adding go vet from hack-a-thon (#5328) * Adding go vet to the api package * Adding go vet to app package * Adding go vet to manualtesting package * Adding go vet to the model package * Adding go vet to the store dir * Adding go vet to utils package * Adding missing dirs with go files * Fixing up makefile * Fixing up makefile * Removing root dir --- store/sql_store.go | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) (limited to 'store/sql_store.go') diff --git a/store/sql_store.go b/store/sql_store.go index 214bce720..03867cc44 100644 --- a/store/sql_store.go +++ b/store/sql_store.go @@ -220,16 +220,14 @@ func (ss *SqlStore) TotalReadDbConnections() int { if len(utils.Cfg.SqlSettings.DataSourceReplicas) == 0 { return 0 - } else { - count := 0 - for _, db := range ss.replicas { - count = count + db.Db.Stats().OpenConnections - } + } - return count + count := 0 + for _, db := range ss.replicas { + count = count + db.Db.Stats().OpenConnections } - return 0 + return count } func (ss *SqlStore) GetCurrentSchemaVersion() string { @@ -722,7 +720,7 @@ func (me mattermConverter) FromDb(target interface{}) (gorp.CustomScanner, bool) b := []byte(*s) return json.Unmarshal(b, target) } - return gorp.CustomScanner{new(string), target, binder}, true + return gorp.CustomScanner{Holder: new(string), Target: target, Binder: binder}, true case *model.StringArray: binder := func(holder, target interface{}) error { s, ok := holder.(*string) @@ -732,7 +730,7 @@ func (me mattermConverter) FromDb(target interface{}) (gorp.CustomScanner, bool) b := []byte(*s) return json.Unmarshal(b, target) } - return gorp.CustomScanner{new(string), target, binder}, true + return gorp.CustomScanner{Holder: new(string), Target: target, Binder: binder}, true case *model.EncryptStringMap: binder := func(holder, target interface{}) error { s, ok := holder.(*string) @@ -748,7 +746,7 @@ func (me mattermConverter) FromDb(target interface{}) (gorp.CustomScanner, bool) b := []byte(ue) return json.Unmarshal(b, target) } - return gorp.CustomScanner{new(string), target, binder}, true + return gorp.CustomScanner{Holder: new(string), Target: target, Binder: binder}, true case *model.StringInterface: binder := func(holder, target interface{}) error { s, ok := holder.(*string) @@ -758,7 +756,7 @@ func (me mattermConverter) FromDb(target interface{}) (gorp.CustomScanner, bool) b := []byte(*s) return json.Unmarshal(b, target) } - return gorp.CustomScanner{new(string), target, binder}, true + return gorp.CustomScanner{Holder: new(string), Target: target, Binder: binder}, true } return gorp.CustomScanner{}, false -- cgit v1.2.3-1-g7c22