1
0
mirror of https://github.com/golang/go synced 2024-11-23 07:20:06 -07:00

misc/pprof: support web profiles on windows/MinGW

LGTM=bradfitz
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/117060043
This commit is contained in:
ChaiShushan 2014-07-23 10:35:04 -07:00 committed by Brad Fitzpatrick
parent e91704af27
commit 8cb040771b

View File

@ -724,18 +724,24 @@ sub RunWeb {
my $fname = shift;
print STDERR "Loading web page file:///$fname\n";
if (`uname` =~ /Darwin/) {
my $uname = `uname`;
if ($uname =~ /Darwin/) {
# OS X: open will use standard preference for SVG files.
system("/usr/bin/open", $fname);
return;
}
if (`uname` =~ /CYGWIN/) {
if ($uname =~ /CYGWIN/) {
# Windows(cygwin): open will use standard preference for SVG files.
my $winname = `cygpath -wa $fname`;
system("explorer.exe", $winname);
return;
}
if ($uname =~ /MINGW/) {
# Windows(MinGW): open will use standard preference for SVG files.
system("cmd", "/c", "start", $fname);
return;
}
# Some kind of Unix; try generic symlinks, then specific browsers.
# (Stop once we find one.)