mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-19 18:32:23 +00:00
swamr/shed: propagate error in example store close method.
This commit is contained in:
parent
7dfada1d97
commit
aadd1d2f65
1 changed files with 3 additions and 2 deletions
|
|
@ -297,8 +297,8 @@ func (s *Store) PutSchema(name string) (err error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Close closes the underlying database.
|
// Close closes the underlying database.
|
||||||
func (s *Store) Close() {
|
func (s *Store) Close() error {
|
||||||
s.db.Close()
|
return s.db.Close()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Example_store constructs a simple storage implementation using shed package.
|
// Example_store constructs a simple storage implementation using shed package.
|
||||||
|
|
@ -313,6 +313,7 @@ func Example_store() {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
}
|
}
|
||||||
|
defer s.Close()
|
||||||
|
|
||||||
ch := storage.GenerateRandomChunk(1024)
|
ch := storage.GenerateRandomChunk(1024)
|
||||||
err = s.Put(context.Background(), ch)
|
err = s.Put(context.Background(), ch)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue