Skip to content

Commit

Permalink
Fix slice make
Browse files Browse the repository at this point in the history
It needs to be of length 0 to allow for append from 0.
  • Loading branch information
ankur22 committed Nov 14, 2024
1 parent 241af93 commit 134399b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion js/modules/gomodule.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func (gm *goModule) Instantiate(rt *sobek.Runtime) (sobek.CyclicModuleInstance,
gm.exportedNames = obj.GetOwnPropertyNames()
}
default:
gm.exportedNames = make([]string, len(named))
gm.exportedNames = make([]string, 0, len(named))
for name := range named {
gm.exportedNames = append(gm.exportedNames, name)
}
Expand Down

0 comments on commit 134399b

Please sign in to comment.