aboutsummaryrefslogtreecommitdiff
path: root/db_test.go
diff options
context:
space:
mode:
authorKevin Gillette <extemporalgenome@gmail.com>2014-04-25 15:38:42 -0600
committerKevin Gillette <extemporalgenome@gmail.com>2014-04-25 15:38:42 -0600
commit1879d88c4366fcc64829a95423cdb1d0024d3472 (patch)
tree27fa5fd6505caad44f00a4c949a2241bb492e740 /db_test.go
parentMerge pull request #139 from Shopify/moar_c_cursor (diff)
downloaddedo-1879d88c4366fcc64829a95423cdb1d0024d3472.tar.gz
dedo-1879d88c4366fcc64829a95423cdb1d0024d3472.tar.xz
Printf's %s and %q do the right thing with []byte; removed string conversion.
Diffstat (limited to 'db_test.go')
-rw-r--r--db_test.go8
1 files changed, 4 insertions, 4 deletions
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
})