mirror of
https://github.com/etcd-io/bbolt.git
synced 2025-04-27 13:12:47 +00:00
Fix ExampleBucket_Put
to use db.View
instead of db.Update
.
This commit is contained in:
parent
2ee5806031
commit
a9189ddefb
@ -939,7 +939,7 @@ func ExampleBucket_Put() {
|
||||
})
|
||||
|
||||
// Read value back in a different read-only transaction.
|
||||
db.Update(func(tx *Tx) error {
|
||||
db.View(func(tx *Tx) error {
|
||||
value := tx.Bucket([]byte("widgets")).Get([]byte("foo"))
|
||||
fmt.Printf("The value of 'foo' is: %s\n", value)
|
||||
return nil
|
||||
|
Loading…
x
Reference in New Issue
Block a user