Skip to content
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

Exclude middleware/profiler.go in TinyGo, as there's no net/http/pprof pkg #982

Merged
merged 1 commit into from
Feb 18, 2025

Conversation

cxjava
Copy link
Contributor

@cxjava cxjava commented Feb 18, 2025

when I want to use middleware in tinygo, it will failed because of https://github.com/go-chi/chi/blob/master/middleware/profiler.go, there is no package net/http/pprof for tinygo.

	r := chi.NewRouter()
	r.Use(middleware.CleanPath)
	r.Use(middleware.RealIP)
	r.Use(middleware.Logger)
	r.Use(middleware.Recoverer)

error output:

../../../go/pkg/mod/github.com/go-chi/chi/[email protected]/middleware/profiler.go:6:2: 
package net/http/pprof is not in std (/Users/user/Library/Caches/tinygo/goroot-598d56643c1f2b0a17cb7ed7f5003addae1fc3ee5af904a1c5356bb7118a4988/src/net/http/pprof)

we need to exclude middleware/profiler.go when use tinygo.

Copy link
Contributor

@VojtechVitek VojtechVitek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Follow-up for #978. Thanks!

LGTM

@VojtechVitek VojtechVitek changed the title Exclude middleware/profiler.go when use tinygo Exclude middleware/profiler.go in TinyGo, as there's no net/http/pprof pkg Feb 18, 2025
@VojtechVitek VojtechVitek merged commit d7034fd into go-chi:master Feb 18, 2025
10 checks passed
@cxjava cxjava deleted the patch-1 branch February 18, 2025 09:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants