Makes wazero.CompiledCode an interface instead of a struct (#519)
This makes wazero.CompiledCode an interface instead of a struct to prevent it from being used incorrectly. For example, even though the fields are not exported, someone can mistakenly instantiate this when it is a struct, and in doing so violate internal assumptions. Signed-off-by: Adrian Cole <adrian@tetrate.io>
This commit is contained in:
@@ -344,8 +344,9 @@ func TestNewModuleBuilder_Build(t *testing.T) {
|
||||
|
||||
t.Run(tc.name, func(t *testing.T) {
|
||||
b := tc.input(NewRuntime()).(*moduleBuilder)
|
||||
m, err := b.Build(testCtx)
|
||||
compiled, err := b.Build(testCtx)
|
||||
require.NoError(t, err)
|
||||
m := compiled.(*compiledCode)
|
||||
|
||||
requireHostModuleEquals(t, tc.expected, m.module)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user