Skip to content

Support http.Request SetPathValue method #35

Open
@cxjava

Description

@cxjava

I am attempting to utilize the Chi router in a WASM module, but I encounter an error during the build process with TinyGo.

I guess it is because of TinyGo net package don't have the SetPathValue method.

Would you be able to assist in diagnosing the problem?

path_value.go in chi

tinygo build -o ./build/app0.wasm -target wasm 
# github.com/go-chi/chi/v5
../../../../go/pkg/mod/github.com/go-chi/chi/v5@v5.1.0/path_value.go:18:5: r.SetPathValue undefined (type *http.Request has no field or method SetPathValue)

go version : go version go1.23.1 darwin/amd64
tinygo version: tinygo version 0.33.0 darwin/amd64 (using go version go1.23.1 and LLVM version 18.1.2)

package main

import (
	"net/http"

	"github.com/go-chi/chi/v5"
)

func main() {
	r := chi.NewRouter()
	r.Get("/", func(w http.ResponseWriter, r *http.Request) {
		w.Write([]byte("welcome"))
	})
	http.ListenAndServe(":3000", r)
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy