Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 458cf91

Browse files
committed
entc/clean: fixed golangci-lint errors
1 parent c81e8a5 commit 458cf91

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

cmd/entc/entc.go

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -69,12 +69,7 @@ func main() {
6969
"entc describe github.com/a8m/x",
7070
),
7171
Args: cobra.ExactArgs(1),
72-
Run: func(cmd *cobra.Command, path []string) {
73-
graph, err := entc.LoadGraph(path[0], &gen.Config{})
74-
failOnErr(err)
75-
p := printer{os.Stdout}
76-
p.Print(graph)
77-
},
72+
Run: describe,
7873
},
7974
func() *cobra.Command {
8075
var (
@@ -204,6 +199,13 @@ func examples(ex ...string) string {
204199
return strings.Join(ex, "\n")
205200
}
206201

202+
func describe(cmd *cobra.Command, path []string) {
203+
graph, err := entc.LoadGraph(path[0], &gen.Config{})
204+
failOnErr(err)
205+
p := printer{os.Stdout}
206+
p.Print(graph)
207+
}
208+
207209
func clean(cmd *cobra.Command, path []string) {
208210
cleanup := make([]string, 0)
209211
cleanup = append(cleanup, filepath.Join(path[0], "migrate"))
@@ -222,7 +224,7 @@ func clean(cmd *cobra.Command, path []string) {
222224
fnamePathWithoutExt := filepath.Join(path[0], strings.TrimRight(fname, ext))
223225
cleanup = append(cleanup, fnamePathWithoutExt)
224226
cleanup = append(cleanup, fnamePathWithoutExt+".go")
225-
filepath.Walk(path[0], func(walkpath string, info os.FileInfo, err error) error {
227+
_ = filepath.Walk(path[0], func(walkpath string, info os.FileInfo, err error) error {
226228
match, _ := filepath.Match(fnamePathWithoutExt+"*", walkpath)
227229
if match {
228230
cleanup = append(cleanup, walkpath)

0 commit comments

Comments
 (0)