Skip to content

Commit

Permalink
rename stdout output
Browse files Browse the repository at this point in the history
  • Loading branch information
hb-chen committed Aug 21, 2022
1 parent c6cf3ff commit 837b768
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions pkg/deps/deps.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"github.com/hb-chen/deps/pkg/graph/mod"
"github.com/hb-chen/deps/pkg/log"
"github.com/hb-chen/deps/pkg/output"
"github.com/hb-chen/deps/pkg/output/std"
"github.com/hb-chen/deps/pkg/output/stdout"
"github.com/hb-chen/deps/pkg/output/template"
"github.com/hb-chen/deps/pkg/scrape"
"github.com/pkg/errors"
Expand Down Expand Up @@ -113,8 +113,8 @@ func Deps(system, project, tpl, out string, patterns []string) error {
}

// 标准输出
stdOut := std.NewOutput()
if err := stdOut.Generate(deps); err != nil {
std := stdout.NewOutput()
if err := std.Generate(deps); err != nil {
log.Logger.Error(err)
}
}
Expand Down
8 changes: 4 additions & 4 deletions pkg/output/std/std.go → pkg/output/stdout/stdout.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package std
package stdout

import (
"fmt"
Expand All @@ -7,9 +7,9 @@ import (
"github.com/hb-chen/deps/pkg/output"
)

type std struct{}
type stdout struct{}

func (*std) Generate(deps map[string]*output.Dependency) error {
func (*stdout) Generate(deps map[string]*output.Dependency) error {
fmt.Println("Dependencies:")
for _, dep := range deps {
fmt.Printf("Pkg: %v, Licenses: %v , Direct: %v ,Advisories: %v \n", dep.Package,
Expand All @@ -21,5 +21,5 @@ func (*std) Generate(deps map[string]*output.Dependency) error {
}

func NewOutput() output.Output {
return &std{}
return &stdout{}
}

0 comments on commit 837b768

Please sign in to comment.