How to use marwan-at-work/wasm-fetch module?
omani opened this issue · comments
HAH! Sun commented
hi,
how am I supposed to use this module when I use //go:build !wasm
in my code but want to make use of https://github.com/marwan-at-work/wasm-fetch module? when I build it says: build constraints exclude all go files in syscall/js
(which the mentioned module uses as a dependency).
any ideas?
Matt Crawford commented
Here's one way to handle this: my wasm-fetch fork
Basically you need to provide a do nothing implementation for when the GOARCH is !wasm
. This fork also refactored out the Opts
and Response
structs so they are available when compiling !wasm
HAH! Sun commented
that worked. thank you very much.