Skip to content

Commit 6afebe8

Browse files
committed
Change to golang style vars and statements
Based on feedback from @bradfitz, * Change variable name to camelCase * use assignment and check in the if block * Use %q instead of %s to print useful error message
1 parent 67dade7 commit 6afebe8

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

consistenthash/consistenthash_test.go

+2-3
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,8 @@ func TestHashing(t *testing.T) {
3636

3737
// Get a value before any key is added to the hash
3838
// Should yield an empty string
39-
empty_value := hash.Get("empty key")
40-
if empty_value != "" {
41-
t.Errorf("Expecting empty string, got %s", empty_value)
39+
if emptyHashValue := hash.Get("empty hash key"); emptyHashValue != "" {
40+
t.Errorf("Get on an empty hash = %q; want empty string", emptyHashValue)
4241
}
4342

4443
// Given the above hash function, this will give replicas with "hashes":

0 commit comments

Comments
 (0)