From d5b97f614eb02399f7b4ed6615fae094362d151d Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Mon, 31 Oct 2016 12:09:03 -0400 Subject: [PATCH] cmd/pprof: move cmd/internal/pprof back to cmd/pprof/internal MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- .../pprof => pprof/internal}/commands/commands.go | 8 ++++---- .../pprof => pprof/internal}/driver/driver.go | 8 ++++---- .../pprof => pprof/internal}/driver/interactive.go | 4 ++-- .../pprof => pprof/internal}/fetch/fetch.go | 2 +- .../pprof => pprof/internal}/plugin/plugin.go | 0 .../pprof => pprof/internal}/report/report.go | 2 +- .../pprof => pprof/internal}/report/source.go | 2 +- .../pprof => pprof/internal}/report/source_html.go | 0 .../{internal/pprof => pprof/internal}/svg/svg.go | 0 .../{internal/pprof => pprof/internal}/svg/svgpan.go | 0 .../internal}/symbolizer/symbolizer.go | 2 +- .../pprof => pprof/internal}/symbolz/symbolz.go | 0 .../pprof => pprof/internal}/tempfile/tempfile.go | 0 src/cmd/pprof/pprof.go | 12 ++++++------ 14 files changed, 20 insertions(+), 20 deletions(-) rename src/cmd/{internal/pprof => pprof/internal}/commands/commands.go (98%) rename src/cmd/{internal/pprof => pprof/internal}/driver/driver.go (99%) rename src/cmd/{internal/pprof => pprof/internal}/driver/interactive.go (99%) rename src/cmd/{internal/pprof => pprof/internal}/fetch/fetch.go (98%) rename src/cmd/{internal/pprof => pprof/internal}/plugin/plugin.go (100%) rename src/cmd/{internal/pprof => pprof/internal}/report/report.go (99%) rename src/cmd/{internal/pprof => pprof/internal}/report/source.go (99%) rename src/cmd/{internal/pprof => pprof/internal}/report/source_html.go (100%) rename src/cmd/{internal/pprof => pprof/internal}/svg/svg.go (100%) rename src/cmd/{internal/pprof => pprof/internal}/svg/svgpan.go (100%) rename src/cmd/{internal/pprof => pprof/internal}/symbolizer/symbolizer.go (99%) rename src/cmd/{internal/pprof => pprof/internal}/symbolz/symbolz.go (100%) rename src/cmd/{internal/pprof => pprof/internal}/tempfile/tempfile.go (100%) 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 4a4fb927ef0..143b7c21bc8 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 f3210723cdc..344d458e13b 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 81df976fa10..1fa07a2cd75 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 95d9be6aa26..2e2de575f8c 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 4f5252b28e8..14875c16dbb 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 608e4d561df..7ab7e3861f7 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 d81f3eafafa..06a3976838a 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 01f44566ba3..18479b45a60 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" )