aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/vendor/github.com/google/pprof/internal/driver/webui.go
diff options
context:
space:
mode:
authorDmitri Shuralyov <dmitshur@golang.org>2025-08-13 16:48:59 -0400
committerGopher Robot <gobot@golang.org>2025-08-13 15:06:59 -0700
commitde9b6f98759f718fb48ecef22c2275ac98f1871d (patch)
tree98c235d281d99e2b7c18a3cd5af57fc05edad369 /src/cmd/vendor/github.com/google/pprof/internal/driver/webui.go
parent674c5f0edd82b5d1dd5cb44eb4b85830245c151e (diff)
downloadgo-de9b6f98759f718fb48ecef22c2275ac98f1871d.tar.xz
cmd/pprof: update vendored github.com/google/pprof
Pull in the latest published version of github.com/google/pprof as part of the continuous process of keeping Go's dependencies up to date. For #36905. [git-generate] cd src/cmd go get github.com/google/pprof@v0.0.0-20250630185457-6e76a2b096b5 go mod tidy go mod vendor Change-Id: Icfa35291f629fcffae67238704e59e17ee05e0b5 Reviewed-on: https://go-review.googlesource.com/c/go/+/696015 Reviewed-by: David Chase <drchase@google.com> Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Diffstat (limited to 'src/cmd/vendor/github.com/google/pprof/internal/driver/webui.go')
-rw-r--r--src/cmd/vendor/github.com/google/pprof/internal/driver/webui.go13
1 files changed, 4 insertions, 9 deletions
diff --git a/src/cmd/vendor/github.com/google/pprof/internal/driver/webui.go b/src/cmd/vendor/github.com/google/pprof/internal/driver/webui.go
index dd628f7c2d..ac7465c93e 100644
--- a/src/cmd/vendor/github.com/google/pprof/internal/driver/webui.go
+++ b/src/cmd/vendor/github.com/google/pprof/internal/driver/webui.go
@@ -19,11 +19,13 @@ import (
"fmt"
"html/template"
"io"
+ "maps"
"net"
"net/http"
gourl "net/url"
"os"
"os/exec"
+ "slices"
"strconv"
"strings"
"time"
@@ -107,9 +109,7 @@ func serveWebInterface(hostport string, p *profile.Profile, o *plugin.Options, d
for n, c := range pprofCommands {
ui.help[n] = c.description
}
- for n, help := range configHelp {
- ui.help[n] = help
- }
+ maps.Copy(ui.help, configHelp)
ui.help["details"] = "Show information about the profile and this view"
ui.help["graph"] = "Display profile as a directed graph"
ui.help["flamegraph"] = "Display profile as a flame graph"
@@ -227,12 +227,7 @@ func redirectWithQuery(path string, code int) http.HandlerFunc {
}
func isLocalhost(host string) bool {
- for _, v := range []string{"localhost", "127.0.0.1", "[::1]", "::1"} {
- if host == v {
- return true
- }
- }
- return false
+ return slices.Contains([]string{"localhost", "127.0.0.1", "[::1]", "::1"}, host)
}
func openBrowser(url string, o *plugin.Options) {