Browse Source

add string method for cow host list

Chris Bannister 10 years ago
parent
commit
02e16dfe04
1 changed files with 5 additions and 0 deletions
  1. 5 0
      policies.go

+ 5 - 0
policies.go

@@ -5,6 +5,7 @@
 package gocql
 
 import (
+	"fmt"
 	"log"
 	"sync"
 	"sync/atomic"
@@ -18,6 +19,10 @@ type cowHostList struct {
 	mu   sync.Mutex
 }
 
+func (c *cowHostList) String() string {
+	return fmt.Sprintf("%+v", c.get())
+}
+
 func (c *cowHostList) get() []*HostInfo {
 	// TODO(zariel): should we replace this with []*HostInfo?
 	l, ok := c.list.Load().(*[]*HostInfo)