-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: avoid panic in init godeltaprof/http/pprof for go 1.23 (#119)
* fix: avoid panic in init godeltaprof/http/pprof * simplify: just use "GET " all the time on go 1.22
- Loading branch information
1 parent
278dd8c
commit edd64fd
Showing
3 changed files
with
21 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
//go:build !go1.22 | ||
|
||
package pprof | ||
|
||
func routePrefix() string { | ||
return "" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
//go:build go1.22 | ||
|
||
package pprof | ||
|
||
func routePrefix() string { | ||
// As of go 1.23 we will panic if we don't prefix with "GET " | ||
// https://github.com/golang/go/blob/9fcffc53593c5cd103630d0d24ef8bd91e17246d/src/net/http/pprof/pprof.go#L98-L97 | ||
// https://github.com/golang/go/commit/9fcffc53593c5cd103630d0d24ef8bd91e17246d | ||
return "GET " | ||
} |