1
0
mirror of https://github.com/golang/go synced 2024-11-19 02:44:44 -07:00

cmd/go: split out cmd/go/internal/get

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: Iec17bf2243de129942ae5fba126ec5f217be7303
Reviewed-on: https://go-review.googlesource.com/36202
Reviewed-by: David Crawshaw <crawshaw@golang.org>
This commit is contained in:
Russ Cox 2017-01-18 13:39:12 -05:00
parent cc03ba3289
commit 6dad55aa25
4 changed files with 15 additions and 20 deletions

View File

@ -2,14 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// +build !cmd_go_bootstrap
// This code is compiled into the real 'go' binary, but it is not
// compiled into the binary that is built during all.bash, so as
// to avoid needing to build net (and thus use cgo) during the
// bootstrap process.
package main
package get
import (
"encoding/xml"

View File

@ -2,7 +2,8 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package main
// Package get implements the ``go get'' command.
package get
import (
"fmt"
@ -22,7 +23,7 @@ import (
"cmd/go/internal/work"
)
var cmdGet = &base.Command{
var CmdGet = &base.Command{
UsageLine: "get [-d] [-f] [-fix] [-insecure] [-t] [-u] [build flags] [packages]",
Short: "download and install packages and dependencies",
Long: `
@ -78,16 +79,16 @@ See also: go build, go install, go clean.
`,
}
var getD = cmdGet.Flag.Bool("d", false, "")
var getF = cmdGet.Flag.Bool("f", false, "")
var getT = cmdGet.Flag.Bool("t", false, "")
var getU = cmdGet.Flag.Bool("u", false, "")
var getFix = cmdGet.Flag.Bool("fix", false, "")
var getInsecure = cmdGet.Flag.Bool("insecure", false, "")
var getD = CmdGet.Flag.Bool("d", false, "")
var getF = CmdGet.Flag.Bool("f", false, "")
var getT = CmdGet.Flag.Bool("t", false, "")
var getU = CmdGet.Flag.Bool("u", false, "")
var getFix = CmdGet.Flag.Bool("fix", false, "")
var getInsecure = CmdGet.Flag.Bool("insecure", false, "")
func init() {
work.AddBuildFlags(cmdGet)
cmdGet.Run = runGet // break init loop
work.AddBuildFlags(CmdGet)
CmdGet.Run = runGet // break init loop
}
func runGet(cmd *base.Command, args []string) {

View File

@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package main
package get
import (
"bytes"

View File

@ -17,6 +17,7 @@ import (
"cmd/go/internal/cfg"
"cmd/go/internal/env"
fmtcmd "cmd/go/internal/fmt"
"cmd/go/internal/get"
"cmd/go/internal/help"
"cmd/go/internal/test"
"cmd/go/internal/work"
@ -32,7 +33,7 @@ func init() {
cmdFix,
fmtcmd.CmdFmt,
cmdGenerate,
cmdGet,
get.CmdGet,
work.CmdInstall,
cmdList,
cmdRun,