From: Russ Cox Date: Mon, 31 Oct 2016 16:09:03 +0000 (-0400) Subject: cmd/pprof: move cmd/internal/pprof back to cmd/pprof/internal X-Git-Tag: go1.8beta1~381 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=d5b97f614eb02399f7b4ed6615fae094362d151d;p=gostls13.git cmd/pprof: move cmd/internal/pprof back to cmd/pprof/internal CL 21870 moved the entire cmd/pprof/internal directory to cmd/internal/pprof for use by cmd/trace, but really cmd/trace only needed cmd/pprof/internal/profile, which became cmd/internal/pprof/profile, and then internal/pprof/profile. Move the rest back under cmd/pprof so that it is clear that no other code is reaching into the guts of cmd/pprof. Just like functions should not be exported unless necessary, internals should not be made visible to more code than necessary. Raúl Silvera noted after the commit of CL 21870 that only the profile package should have moved, but there was no followup fix (until now). Change-Id: I603f4dcb0616df1e5d5eb7372e6fccda57e05079 Reviewed-on: https://go-review.googlesource.com/32453 Run-TryBot: Russ Cox TryBot-Result: Gobot Gobot Reviewed-by: Ian Lance Taylor --- diff --git a/src/cmd/internal/pprof/commands/commands.go b/src/cmd/pprof/internal/commands/commands.go similarity index 98% rename from src/cmd/internal/pprof/commands/commands.go rename to src/cmd/pprof/internal/commands/commands.go index 4a4fb927ef..143b7c21bc 100644 --- a/src/cmd/internal/pprof/commands/commands.go +++ b/src/cmd/pprof/internal/commands/commands.go @@ -16,10 +16,10 @@ import ( "time" "cmd/internal/browser" - "cmd/internal/pprof/plugin" - "cmd/internal/pprof/report" - "cmd/internal/pprof/svg" - "cmd/internal/pprof/tempfile" + "cmd/pprof/internal/plugin" + "cmd/pprof/internal/report" + "cmd/pprof/internal/svg" + "cmd/pprof/internal/tempfile" ) // Commands describes the commands accepted by pprof. diff --git a/src/cmd/internal/pprof/driver/driver.go b/src/cmd/pprof/internal/driver/driver.go similarity index 99% rename from src/cmd/internal/pprof/driver/driver.go rename to src/cmd/pprof/internal/driver/driver.go index f3210723cd..344d458e13 100644 --- a/src/cmd/internal/pprof/driver/driver.go +++ b/src/cmd/pprof/internal/driver/driver.go @@ -21,10 +21,10 @@ import ( "sync" "time" - "cmd/internal/pprof/commands" - "cmd/internal/pprof/plugin" - "cmd/internal/pprof/report" - "cmd/internal/pprof/tempfile" + "cmd/pprof/internal/commands" + "cmd/pprof/internal/plugin" + "cmd/pprof/internal/report" + "cmd/pprof/internal/tempfile" "internal/pprof/profile" ) diff --git a/src/cmd/internal/pprof/driver/interactive.go b/src/cmd/pprof/internal/driver/interactive.go similarity index 99% rename from src/cmd/internal/pprof/driver/interactive.go rename to src/cmd/pprof/internal/driver/interactive.go index 81df976fa1..1fa07a2cd7 100644 --- a/src/cmd/internal/pprof/driver/interactive.go +++ b/src/cmd/pprof/internal/driver/interactive.go @@ -12,8 +12,8 @@ import ( "strconv" "strings" - "cmd/internal/pprof/commands" - "cmd/internal/pprof/plugin" + "cmd/pprof/internal/commands" + "cmd/pprof/internal/plugin" "internal/pprof/profile" ) diff --git a/src/cmd/internal/pprof/fetch/fetch.go b/src/cmd/pprof/internal/fetch/fetch.go similarity index 98% rename from src/cmd/internal/pprof/fetch/fetch.go rename to src/cmd/pprof/internal/fetch/fetch.go index 95d9be6aa2..2e2de575f8 100644 --- a/src/cmd/internal/pprof/fetch/fetch.go +++ b/src/cmd/pprof/internal/fetch/fetch.go @@ -16,7 +16,7 @@ import ( "strings" "time" - "cmd/internal/pprof/plugin" + "cmd/pprof/internal/plugin" "internal/pprof/profile" ) diff --git a/src/cmd/internal/pprof/plugin/plugin.go b/src/cmd/pprof/internal/plugin/plugin.go similarity index 100% rename from src/cmd/internal/pprof/plugin/plugin.go rename to src/cmd/pprof/internal/plugin/plugin.go diff --git a/src/cmd/internal/pprof/report/report.go b/src/cmd/pprof/internal/report/report.go similarity index 99% rename from src/cmd/internal/pprof/report/report.go rename to src/cmd/pprof/internal/report/report.go index 4f5252b28e..14875c16db 100644 --- a/src/cmd/internal/pprof/report/report.go +++ b/src/cmd/pprof/internal/report/report.go @@ -17,7 +17,7 @@ import ( "strings" "time" - "cmd/internal/pprof/plugin" + "cmd/pprof/internal/plugin" "internal/pprof/profile" ) diff --git a/src/cmd/internal/pprof/report/source.go b/src/cmd/pprof/internal/report/source.go similarity index 99% rename from src/cmd/internal/pprof/report/source.go rename to src/cmd/pprof/internal/report/source.go index 608e4d561d..7ab7e3861f 100644 --- a/src/cmd/internal/pprof/report/source.go +++ b/src/cmd/pprof/internal/report/source.go @@ -18,7 +18,7 @@ import ( "strconv" "strings" - "cmd/internal/pprof/plugin" + "cmd/pprof/internal/plugin" ) // printSource prints an annotated source listing, include all diff --git a/src/cmd/internal/pprof/report/source_html.go b/src/cmd/pprof/internal/report/source_html.go similarity index 100% rename from src/cmd/internal/pprof/report/source_html.go rename to src/cmd/pprof/internal/report/source_html.go diff --git a/src/cmd/internal/pprof/svg/svg.go b/src/cmd/pprof/internal/svg/svg.go similarity index 100% rename from src/cmd/internal/pprof/svg/svg.go rename to src/cmd/pprof/internal/svg/svg.go diff --git a/src/cmd/internal/pprof/svg/svgpan.go b/src/cmd/pprof/internal/svg/svgpan.go similarity index 100% rename from src/cmd/internal/pprof/svg/svgpan.go rename to src/cmd/pprof/internal/svg/svgpan.go diff --git a/src/cmd/internal/pprof/symbolizer/symbolizer.go b/src/cmd/pprof/internal/symbolizer/symbolizer.go similarity index 99% rename from src/cmd/internal/pprof/symbolizer/symbolizer.go rename to src/cmd/pprof/internal/symbolizer/symbolizer.go index d81f3eafaf..06a3976838 100644 --- a/src/cmd/internal/pprof/symbolizer/symbolizer.go +++ b/src/cmd/pprof/internal/symbolizer/symbolizer.go @@ -13,7 +13,7 @@ import ( "path/filepath" "strings" - "cmd/internal/pprof/plugin" + "cmd/pprof/internal/plugin" "internal/pprof/profile" ) diff --git a/src/cmd/internal/pprof/symbolz/symbolz.go b/src/cmd/pprof/internal/symbolz/symbolz.go similarity index 100% rename from src/cmd/internal/pprof/symbolz/symbolz.go rename to src/cmd/pprof/internal/symbolz/symbolz.go diff --git a/src/cmd/internal/pprof/tempfile/tempfile.go b/src/cmd/pprof/internal/tempfile/tempfile.go similarity index 100% rename from src/cmd/internal/pprof/tempfile/tempfile.go rename to src/cmd/pprof/internal/tempfile/tempfile.go diff --git a/src/cmd/pprof/pprof.go b/src/cmd/pprof/pprof.go index 01f44566ba..18479b45a6 100644 --- a/src/cmd/pprof/pprof.go +++ b/src/cmd/pprof/pprof.go @@ -15,12 +15,12 @@ import ( "sync" "cmd/internal/objfile" - "cmd/internal/pprof/commands" - "cmd/internal/pprof/driver" - "cmd/internal/pprof/fetch" - "cmd/internal/pprof/plugin" - "cmd/internal/pprof/symbolizer" - "cmd/internal/pprof/symbolz" + "cmd/pprof/internal/commands" + "cmd/pprof/internal/driver" + "cmd/pprof/internal/fetch" + "cmd/pprof/internal/plugin" + "cmd/pprof/internal/symbolizer" + "cmd/pprof/internal/symbolz" "internal/pprof/profile" )