From 1879d88c4366fcc64829a95423cdb1d0024d3472 Mon Sep 17 00:00:00 2001 From: Kevin Gillette Date: Fri, 25 Apr 2014 15:38:42 -0600 Subject: Printf's %s and %q do the right thing with []byte; removed string conversion. --- db_test.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'db_test.go') diff --git a/db_test.go b/db_test.go index 57c356e..d0933e8 100644 --- a/db_test.go +++ b/db_test.go @@ -375,7 +375,7 @@ func ExampleDB_Update() { if err == nil { db.View(func(tx *Tx) error { value := tx.Bucket([]byte("widgets")).Get([]byte("foo")) - fmt.Printf("The value of 'foo' is: %s\n", string(value)) + fmt.Printf("The value of 'foo' is: %s\n", value) return nil }) } @@ -402,7 +402,7 @@ func ExampleDB_View() { // Access data from within a read-only transactional block. db.View(func(tx *Tx) error { v := tx.Bucket([]byte("people")).Get([]byte("john")) - fmt.Printf("John's last name is %s.\n", string(v)) + fmt.Printf("John's last name is %s.\n", v) return nil }) @@ -434,7 +434,7 @@ func ExampleDB_Begin_ReadOnly() { tx, _ = db.Begin(false) c := tx.Bucket([]byte("widgets")).Cursor() for k, v := c.First(); k != nil; k, v = c.Next() { - fmt.Printf("%s likes %s\n", string(k), string(v)) + fmt.Printf("%s likes %s\n", k, v) } tx.Rollback() @@ -469,7 +469,7 @@ func ExampleDB_CopyFile() { // Ensure that the key exists in the copy. db2.View(func(tx *Tx) error { value := tx.Bucket([]byte("widgets")).Get([]byte("foo")) - fmt.Printf("The value for 'foo' in the clone is: %s\n", string(value)) + fmt.Printf("The value for 'foo' in the clone is: %s\n", value) return nil }) -- cgit v1.2.3