Skip to content
This repository was archived by the owner on Sep 9, 2020. It is now read-only.

Commit 3466871

Browse files
committed
Move loggers.go from cmd/dep to project root
- Moves loggers.go to project root under package dep - Changes all the Loggers references to refer to dep.Loggers.
1 parent 09b46aa commit 3466871

File tree

8 files changed

+11
-11
lines changed

8 files changed

+11
-11
lines changed

cmd/dep/ensure.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ type ensureCommand struct {
101101
overrides stringSlice
102102
}
103103

104-
func (cmd *ensureCommand) Run(ctx *dep.Ctx, loggers *Loggers, args []string) error {
104+
func (cmd *ensureCommand) Run(ctx *dep.Ctx, loggers *dep.Loggers, args []string) error {
105105
if cmd.examples {
106106
loggers.Err.Println(strings.TrimSpace(ensureExamples))
107107
return nil

cmd/dep/hash_in.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ func (cmd *hashinCommand) Register(fs *flag.FlagSet) {}
2323

2424
type hashinCommand struct{}
2525

26-
func (hashinCommand) Run(ctx *dep.Ctx, loggers *Loggers, args []string) error {
26+
func (hashinCommand) Run(ctx *dep.Ctx, loggers *dep.Loggers, args []string) error {
2727
p, err := ctx.LoadProject("")
2828
if err != nil {
2929
return err

cmd/dep/init.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ func trimPathPrefix(p1, p2 string) string {
5858
return p1
5959
}
6060

61-
func (cmd *initCommand) Run(ctx *dep.Ctx, loggers *Loggers, args []string) error {
61+
func (cmd *initCommand) Run(ctx *dep.Ctx, loggers *dep.Loggers, args []string) error {
6262
if len(args) > 1 {
6363
return errors.Errorf("too many args (%d)", len(args))
6464
}
@@ -277,7 +277,7 @@ type projectData struct {
277277
ondisk map[gps.ProjectRoot]gps.Version // projects that were found on disk
278278
}
279279

280-
func getProjectData(ctx *dep.Ctx, loggers *Loggers, pkgT pkgtree.PackageTree, cpr string, sm gps.SourceManager) (projectData, error) {
280+
func getProjectData(ctx *dep.Ctx, loggers *dep.Loggers, pkgT pkgtree.PackageTree, cpr string, sm gps.SourceManager) (projectData, error) {
281281
constraints := make(gps.ProjectConstraints)
282282
dependencies := make(map[gps.ProjectRoot][]string)
283283
packages := make(map[string]bool)

cmd/dep/main.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ type command interface {
2525
LongHelp() string // "Foo the first bar meeting the following conditions..."
2626
Register(*flag.FlagSet) // command-specific flags
2727
Hidden() bool // indicates whether the command should be hidden from help output
28-
Run(*dep.Ctx, *Loggers, []string) error
28+
Run(*dep.Ctx, *dep.Loggers, []string) error
2929
}
3030

3131
func main() {
@@ -141,7 +141,7 @@ func (c *Config) Run() (exitCode int) {
141141
return
142142
}
143143

144-
loggers := &Loggers{
144+
loggers := &dep.Loggers{
145145
Out: log.New(c.Stdout, "", 0),
146146
Err: errLogger,
147147
Verbose: *verbose,

cmd/dep/prune.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ func (cmd *pruneCommand) Hidden() bool { return false }
3636
func (cmd *pruneCommand) Register(fs *flag.FlagSet) {
3737
}
3838

39-
func (cmd *pruneCommand) Run(ctx *dep.Ctx, loggers *Loggers, args []string) error {
39+
func (cmd *pruneCommand) Run(ctx *dep.Ctx, loggers *dep.Loggers, args []string) error {
4040
p, err := ctx.LoadProject("")
4141
if err != nil {
4242
return err

cmd/dep/remove.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ type removeCommand struct {
4141
keepSource bool
4242
}
4343

44-
func (cmd *removeCommand) Run(ctx *dep.Ctx, loggers *Loggers, args []string) error {
44+
func (cmd *removeCommand) Run(ctx *dep.Ctx, loggers *dep.Loggers, args []string) error {
4545
p, err := ctx.LoadProject("")
4646
if err != nil {
4747
return err

cmd/dep/status.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ func (out *dotOutput) MissingHeader() {}
181181
func (out *dotOutput) MissingLine(ms *MissingStatus) {}
182182
func (out *dotOutput) MissingFooter() {}
183183

184-
func (cmd *statusCommand) Run(ctx *dep.Ctx, loggers *Loggers, args []string) error {
184+
func (cmd *statusCommand) Run(ctx *dep.Ctx, loggers *dep.Loggers, args []string) error {
185185
p, err := ctx.LoadProject("")
186186
if err != nil {
187187
return err
@@ -248,7 +248,7 @@ type MissingStatus struct {
248248
MissingPackages []string
249249
}
250250

251-
func runStatusAll(loggers *Loggers, out outputter, p *dep.Project, sm gps.SourceManager) error {
251+
func runStatusAll(loggers *dep.Loggers, out outputter, p *dep.Project, sm gps.SourceManager) error {
252252
if p.Lock == nil {
253253
// TODO if we have no lock file, do...other stuff
254254
return nil

cmd/dep/loggers.go renamed to loggers.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Use of this source code is governed by a BSD-style
33
// license that can be found in the LICENSE file.
44

5-
package main
5+
package dep
66

77
import "log"
88

0 commit comments

Comments
 (0)