maxence-charriere / go-app

A package to build progressive web apps with Go programming language and WebAssembly.

Home Page:https://go-app.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to use marwan-at-work/wasm-fetch module?

omani opened this issue · comments

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?

@omani

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

that worked. thank you very much.