Some code improvements

* Rewrite empty string checks more idiomatically.
* Change strings.ToLower comparisons to strings.EqualFold.
* Rewrite switch statement with only one case as if.
This commit is contained in:
Kirill Motkov committed 2019-06-28 17:53:44 +03:00
1 parent 4c93d36d49
commit 0401a91ef4
26 files changed
+38 -39

No files matched your search

+1 -1
View File
@@ -23,7 +23,7 @@ type BalancingRule struct {
}
func (r *BalancingRule) Build() (*router.BalancingRule, error) {
if len(r.Tag) == 0 {
if r.Tag == "" {
return nil, newError("empty balancer tag")
}
if len(r.Selectors) == 0 {