Skip to content

Handles new wasmexport directive in Go #34

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions handler/handler.go
Original file line number Diff line number Diff line change
@@ -17,7 +17,8 @@ var HandleRequestFn api.HandleRequest = func(api.Request, api.Response) (next bo
// handleRequest is only exported to the host.
//
//go:export handle_request
func handleRequest() (ctxNext uint64) { //nolint
//go:wasmexport handle_request
func handleRequest() (ctxNext uint64) { // nolint
next, reqCtx := HandleRequestFn(wasmRequest{}, wasmResponse{})
ctxNext = uint64(reqCtx) << 32
if next {
@@ -33,7 +34,8 @@ var HandleResponseFn api.HandleResponse = func(uint32, api.Request, api.Response
// handleResponse is only exported to the host.
//
//go:export handle_response
func handleResponse(reqCtx uint32, isError uint32) { //nolint
//go:wasmexport handle_response
func handleResponse(reqCtx uint32, isError uint32) { // nolint
isErrorB := false
if isError == 1 {
isErrorB = true
2 changes: 1 addition & 1 deletion handler/internal/imports/imports.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//go:build tinygo.wasm
//go:build tinygo.wasm || wasip1

package imports

2 changes: 1 addition & 1 deletion handler/internal/imports/imports_stub.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//go:build !tinygo.wasm
//go:build !tinygo.wasm && !wasip1

package imports