Skip to content

Commit

Permalink
cmd/go: split out cmd/go/internal/fmt
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
rsc committed Feb 3, 2017
1 parent 4efe925 commit 36ce197
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
11 changes: 6 additions & 5 deletions src/cmd/go/fmt.go → src/cmd/go/internal/fmt/fmt.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
3 changes: 2 additions & 1 deletion src/cmd/go/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -28,7 +29,7 @@ func init() {
cmdEnv,
cmdBug,
cmdFix,
cmdFmt,
fmtcmd.CmdFmt,
cmdGenerate,
cmdGet,
work.CmdInstall,
Expand Down

0 comments on commit 36ce197

Please sign in to comment.