浏览代码

gofmt + authors

Bo Blanton 9 年之前
父节点
当前提交
14fa6eca11
共有 2 个文件被更改,包括 5 次插入4 次删除
  1. 1 0
      AUTHORS
  2. 4 4
      token.go

+ 1 - 0
AUTHORS

@@ -82,3 +82,4 @@ Robert Nix <robert@nicerobot.org>
 Nathan Youngman <git@nathany.com>
 Charles Law <charles.law@gmail.com>; <claw@conduce.com>
 Nathan Davies <nathanjamesdavies@gmail.com>
+Bo Blanton <bo.blanton@gmail.com>

+ 4 - 4
token.go

@@ -203,13 +203,13 @@ func (t *tokenRing) GetHostForToken(token token) *HostInfo {
 	if t == nil {
 		return nil
 	}
-	
+
 	l := len(t.tokens)
 	// no host tokens, no available hosts
-	if l == 0{
+	if l == 0 {
 		return nil
 	}
-	
+
 	// find the primary replica
 	ringIndex := sort.Search(
 		l,
@@ -217,7 +217,7 @@ func (t *tokenRing) GetHostForToken(token token) *HostInfo {
 			return !t.tokens[i].Less(token)
 		},
 	)
-	
+
 	if ringIndex == l {
 		// wrap around to the first in the ring
 		ringIndex = 0