Skip to content

Commit f1116e0

Browse files
committed
Handles new wasmexport directive in Go
1 parent e57ec90 commit f1116e0

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

handler/handler.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ var HandleRequestFn api.HandleRequest = func(api.Request, api.Response) (next bo
1717
// handleRequest is only exported to the host.
1818
//
1919
//go:export handle_request
20-
func handleRequest() (ctxNext uint64) { //nolint
20+
//go:wasmexport handle_request
21+
func handleRequest() (ctxNext uint64) { // nolint
2122
next, reqCtx := HandleRequestFn(wasmRequest{}, wasmResponse{})
2223
ctxNext = uint64(reqCtx) << 32
2324
if next {
@@ -33,7 +34,8 @@ var HandleResponseFn api.HandleResponse = func(uint32, api.Request, api.Response
3334
// handleResponse is only exported to the host.
3435
//
3536
//go:export handle_response
36-
func handleResponse(reqCtx uint32, isError uint32) { //nolint
37+
//go:wasmexport handle_response
38+
func handleResponse(reqCtx uint32, isError uint32) { // nolint
3739
isErrorB := false
3840
if isError == 1 {
3941
isErrorB = true

handler/internal/imports/imports.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//go:build tinygo.wasm
1+
//go:build tinygo.wasm || wasip1
22

33
package imports
44

handler/internal/imports/imports_stub.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//go:build !tinygo.wasm
1+
//go:build !tinygo.wasm && !wasip1
22

33
package imports
44

0 commit comments

Comments
 (0)