mirror of
https://github.com/golang/go.git
synced 2025-05-30 19:52:53 +00:00
cmd/pprof: run $BROWSER and system browser before Chrome
Fixes #10259. Change-Id: Ica6b8301cc8291785a3c496fb513050813b2d8df Reviewed-on: https://go-review.googlesource.com/12201 Reviewed-by: Andrew Gerrand <adg@golang.org>
This commit is contained in:
parent
9adf684686
commit
2bd1e5e50b
@ -82,7 +82,10 @@ func PProf(c Completer, interactive **bool) Commands {
|
||||
// browsers returns a list of commands to attempt for web visualization
|
||||
// on the current platform
|
||||
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 {
|
||||
case "darwin":
|
||||
cmds = append(cmds, "/usr/bin/open")
|
||||
@ -91,6 +94,7 @@ func browsers() []string {
|
||||
default:
|
||||
cmds = append(cmds, "xdg-open")
|
||||
}
|
||||
cmds = append(cmds, "chrome", "google-chrome", "firefox")
|
||||
return cmds
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user