This repository was archived by the owner on Jun 27, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -100,7 +100,7 @@ func NewDirectory(dserv ipld.DAGService) Directory {
100
100
basicDir := new (BasicDirectory )
101
101
basicDir .node = format .EmptyDirNode ()
102
102
basicDir .dserv = dserv
103
- return UpgradeableDirectory {basicDir }
103
+ return & UpgradeableDirectory {basicDir }
104
104
}
105
105
106
106
// ErrNotADir implies that the given node was not a unixfs directory
@@ -308,7 +308,7 @@ var _ Directory = (*UpgradeableDirectory)(nil)
308
308
309
309
// AddChild implements the `Directory` interface. We check when adding new entries
310
310
// if we should switch to HAMTDirectory according to global option(s).
311
- func (d UpgradeableDirectory ) AddChild (ctx context.Context , name string , nd ipld.Node ) error {
311
+ func (d * UpgradeableDirectory ) AddChild (ctx context.Context , name string , nd ipld.Node ) error {
312
312
if UseHAMTSharding {
313
313
if basicDir , ok := d .Directory .(* BasicDirectory ); ok {
314
314
hamtDir , err := basicDir .SwitchToSharding (ctx )
Original file line number Diff line number Diff line change @@ -105,7 +105,7 @@ func TestUpgradeableDirectory(t *testing.T) {
105
105
ds := mdtest .Mock ()
106
106
UseHAMTSharding = false // Create a BasicDirectory.
107
107
dir := NewDirectory (ds )
108
- if _ , ok := dir .(UpgradeableDirectory ).Directory .(* BasicDirectory ); ! ok {
108
+ if _ , ok := dir .(* UpgradeableDirectory ).Directory .(* BasicDirectory ); ! ok {
109
109
t .Fatal ("UpgradeableDirectory doesn't contain BasicDirectory" )
110
110
}
111
111
@@ -117,7 +117,7 @@ func TestUpgradeableDirectory(t *testing.T) {
117
117
t .Fatal (err )
118
118
}
119
119
120
- if _ , ok := dir .(UpgradeableDirectory ).Directory .(* HAMTDirectory ); ! ok {
120
+ if _ , ok := dir .(* UpgradeableDirectory ).Directory .(* HAMTDirectory ); ! ok {
121
121
t .Fatal ("UpgradeableDirectory wasn't upgraded to HAMTDirectory" )
122
122
}
123
123
}
You can’t perform that action at this time.
0 commit comments