Commit 2bd1e5e5 authored by Russ Cox's avatar Russ Cox

cmd/pprof: run $BROWSER and system browser before Chrome

Fixes #10259.

Change-Id: Ica6b8301cc8291785a3c496fb513050813b2d8df
Reviewed-on: https://go-review.googlesource.com/12201Reviewed-by: default avatarAndrew Gerrand <adg@golang.org>
parent 9adf6846
...@@ -82,7 +82,10 @@ func PProf(c Completer, interactive **bool) Commands { ...@@ -82,7 +82,10 @@ func PProf(c Completer, interactive **bool) Commands {
// browsers returns a list of commands to attempt for web visualization // browsers returns a list of commands to attempt for web visualization
// on the current platform // on the current platform
func browsers() []string { func browsers() []string {
cmds := []string{"chrome", "google-chrome", "firefox"} var cmds []string
if exe := os.Getenv("BROWSER"); exe != "" {
cmds = append(cmds, exe)
}
switch runtime.GOOS { switch runtime.GOOS {
case "darwin": case "darwin":
cmds = append(cmds, "/usr/bin/open") cmds = append(cmds, "/usr/bin/open")
...@@ -91,6 +94,7 @@ func browsers() []string { ...@@ -91,6 +94,7 @@ func browsers() []string {
default: default:
cmds = append(cmds, "xdg-open") cmds = append(cmds, "xdg-open")
} }
cmds = append(cmds, "chrome", "google-chrome", "firefox")
return cmds return cmds
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment