package main
import (
"io"
"net/http"
// "github.com/syumai/workers"
)
func main() {
http.HandleFunc("/hello", func(w http.ResponseWriter, req *http.Request) {
msg := "Hello!"
w.Write([]byte(msg))
})
http.HandleFunc("/echo", func(w http.ResponseWriter, req *http.Request) {
io.Copy(w, req.Body)
})
// workers.Serve(nil) // use http.DefaultServeMux
}
tinygo version 0.41.1 linux/amd64 (using go version go1.25.9 and LLVM version 20.1.1)
tinygotest git:(master) GOOS=js GOARCH=wasm tinygo build -o wasm.wasm main.go
# net/http
/home/labulakalia/sdk/tinygo/src/net/http/roundtrip_js.go:73:12: t.roundTrip undefined (type *Transport has no field or method roundTrip, but does have method RoundTrip)
Build Failed log