diff options
author | Ben Johnson <benbjohnson@yahoo.com> | 2014-04-25 16:13:24 -0600 |
---|---|---|
committer | Ben Johnson <benbjohnson@yahoo.com> | 2014-04-25 16:13:24 -0600 |
commit | 46d83eb14025e1f9b79128325c5c4d811f61b5f7 (patch) | |
tree | 27fa5fd6505caad44f00a4c949a2241bb492e740 /db_test.go | |
parent | Merge pull request #139 from Shopify/moar_c_cursor (diff) | |
parent | Printf's %s and %q do the right thing with []byte; removed string conversion. (diff) | |
download | dedo-46d83eb14025e1f9b79128325c5c4d811f61b5f7.tar.gz dedo-46d83eb14025e1f9b79128325c5c4d811f61b5f7.tar.xz |
Merge pull request #142 from extemporalgenome/Printf-byteslice
Printf's %s and %q already do the right thing with []byte
Diffstat (limited to 'db_test.go')
-rw-r--r-- | db_test.go | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -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 }) |