Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
dms3
go-datastore
Commits
1813f016
Commit
1813f016
authored
Jan 28, 2019
by
Steven Allen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove closer type assertions
We no longer need them.
parent
3f52705c
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
6 additions
and
22 deletions
+6
-22
basic_ds.go
basic_ds.go
+1
-5
keytransform/keytransform.go
keytransform/keytransform.go
+1
-6
mount/mount.go
mount/mount.go
+3
-6
sync/sync.go
sync/sync.go
+1
-5
No files found.
basic_ds.go
View file @
1813f016
package
datastore
package
datastore
import
(
import
(
"io"
"log"
"log"
dsq
"github.com/ipfs/go-datastore/query"
dsq
"github.com/ipfs/go-datastore/query"
...
@@ -244,10 +243,7 @@ func (d *LogBatch) Commit() (err error) {
...
@@ -244,10 +243,7 @@ func (d *LogBatch) Commit() (err error) {
func
(
d
*
LogDatastore
)
Close
()
error
{
func
(
d
*
LogDatastore
)
Close
()
error
{
log
.
Printf
(
"%s: Close
\n
"
,
d
.
Name
)
log
.
Printf
(
"%s: Close
\n
"
,
d
.
Name
)
if
cds
,
ok
:=
d
.
child
.
(
io
.
Closer
);
ok
{
return
d
.
child
.
Close
()
return
cds
.
Close
()
}
return
nil
}
}
func
(
d
*
LogDatastore
)
Check
()
error
{
func
(
d
*
LogDatastore
)
Check
()
error
{
...
...
keytransform/keytransform.go
View file @
1813f016
package
keytransform
package
keytransform
import
(
import
(
"io"
ds
"github.com/ipfs/go-datastore"
ds
"github.com/ipfs/go-datastore"
dsq
"github.com/ipfs/go-datastore/query"
dsq
"github.com/ipfs/go-datastore/query"
)
)
...
@@ -84,10 +82,7 @@ func (d *ktds) Query(q dsq.Query) (dsq.Results, error) {
...
@@ -84,10 +82,7 @@ func (d *ktds) Query(q dsq.Query) (dsq.Results, error) {
}
}
func
(
d
*
ktds
)
Close
()
error
{
func
(
d
*
ktds
)
Close
()
error
{
if
c
,
ok
:=
d
.
child
.
(
io
.
Closer
);
ok
{
return
d
.
child
.
Close
()
return
c
.
Close
()
}
return
nil
}
}
// DiskUsage implements the PersistentDatastore interface.
// DiskUsage implements the PersistentDatastore interface.
...
...
mount/mount.go
View file @
1813f016
...
@@ -5,7 +5,6 @@ package mount
...
@@ -5,7 +5,6 @@ package mount
import
(
import
(
"errors"
"errors"
"fmt"
"fmt"
"io"
"sort"
"sort"
"strings"
"strings"
"sync"
"sync"
...
@@ -195,11 +194,9 @@ func (d *Datastore) IsThreadSafe() {}
...
@@ -195,11 +194,9 @@ func (d *Datastore) IsThreadSafe() {}
func
(
d
*
Datastore
)
Close
()
error
{
func
(
d
*
Datastore
)
Close
()
error
{
for
_
,
d
:=
range
d
.
mounts
{
for
_
,
d
:=
range
d
.
mounts
{
if
c
,
ok
:=
d
.
Datastore
.
(
io
.
Closer
);
ok
{
err
:=
d
.
Datastore
.
Close
()
err
:=
c
.
Close
()
if
err
!=
nil
{
if
err
!=
nil
{
return
err
return
err
}
}
}
}
}
return
nil
return
nil
...
...
sync/sync.go
View file @
1813f016
package
sync
package
sync
import
(
import
(
"io"
"sync"
"sync"
ds
"github.com/ipfs/go-datastore"
ds
"github.com/ipfs/go-datastore"
...
@@ -93,10 +92,7 @@ func (d *MutexDatastore) Batch() (ds.Batch, error) {
...
@@ -93,10 +92,7 @@ func (d *MutexDatastore) Batch() (ds.Batch, error) {
func
(
d
*
MutexDatastore
)
Close
()
error
{
func
(
d
*
MutexDatastore
)
Close
()
error
{
d
.
RWMutex
.
Lock
()
d
.
RWMutex
.
Lock
()
defer
d
.
RWMutex
.
Unlock
()
defer
d
.
RWMutex
.
Unlock
()
if
c
,
ok
:=
d
.
child
.
(
io
.
Closer
);
ok
{
return
d
.
child
.
Close
()
return
c
.
Close
()
}
return
nil
}
}
// DiskUsage implements the PersistentDatastore interface.
// DiskUsage implements the PersistentDatastore interface.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment