From: Russ Cox Date: Wed, 18 Jan 2017 18:18:56 +0000 (-0500) Subject: cmd/go: split out cmd/go/internal/fmt X-Git-Tag: go1.9beta1~1751 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=36ce197c858ea9e187ee59fc18576c73a0a513e7;p=gostls13.git cmd/go: split out cmd/go/internal/fmt This is one CL in a long sequence of changes to break up the go command from one package into a plausible group of packages. This sequence is concerned only with moving code, not changing or cleaning up code. There will still be more cleanup after this sequence. The entire sequence will be submitted together: it is not a goal for the tree to build at every step. For #18653. Change-Id: I8e325d75f553b5d0b6224b56a705d2e2cb895de4 Reviewed-on: https://go-review.googlesource.com/36199 Reviewed-by: David Crawshaw --- diff --git a/src/cmd/go/fmt.go b/src/cmd/go/internal/fmt/fmt.go similarity index 95% rename from src/cmd/go/fmt.go rename to src/cmd/go/internal/fmt/fmt.go index 169a653e7e..1124beeedb 100644 --- a/src/cmd/go/fmt.go +++ b/src/cmd/go/internal/fmt/fmt.go @@ -2,22 +2,23 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -package main +package fmt import ( + "os" + "path/filepath" + "cmd/go/internal/base" "cmd/go/internal/cfg" "cmd/go/internal/load" "cmd/go/internal/str" - "os" - "path/filepath" ) func init() { - cfg.AddBuildFlagsNX(&cmdFmt.Flag) + cfg.AddBuildFlagsNX(&CmdFmt.Flag) } -var cmdFmt = &base.Command{ +var CmdFmt = &base.Command{ Run: runFmt, UsageLine: "fmt [-n] [-x] [packages]", Short: "run gofmt on package sources", diff --git a/src/cmd/go/main.go b/src/cmd/go/main.go index 502e571682..8be210f1d1 100644 --- a/src/cmd/go/main.go +++ b/src/cmd/go/main.go @@ -15,6 +15,7 @@ import ( "cmd/go/internal/base" "cmd/go/internal/cfg" + fmtcmd "cmd/go/internal/fmt" "cmd/go/internal/help" "cmd/go/internal/test" "cmd/go/internal/work" @@ -28,7 +29,7 @@ func init() { cmdEnv, cmdBug, cmdFix, - cmdFmt, + fmtcmd.CmdFmt, cmdGenerate, cmdGet, work.CmdInstall,