Skip to content

Commit bcdcd95

Browse files
committed
refactoring 1
1 parent d5664c8 commit bcdcd95

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

kadai1/tanaka0325/imgconv/imgconv.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,8 @@ func Run(options Options, args Args) error {
1616
return err
1717
}
1818

19-
// get target image paths from args
20-
udns := args.uniq()
21-
paths, err := getPaths(udns, *options.From)
19+
// get target image flepaths from args
20+
paths, err := getTargetFilePaths(args, *options.From)
2221
if err != nil {
2322
return err
2423
}
@@ -45,11 +44,12 @@ func Run(options Options, args Args) error {
4544
return nil
4645
}
4746

48-
func getPaths(dns []string, from string) ([]string, error) {
47+
func getTargetFilePaths(args Args, from string) ([]string, error) {
48+
uns := args.uniq()
4949
paths := []string{}
5050

51-
for _, dn := range dns {
52-
if err := filepath.Walk(dn, func(path string, info os.FileInfo, err error) error {
51+
for _, n := range uns {
52+
if err := filepath.Walk(n, func(path string, info os.FileInfo, err error) error {
5353
if filepath.Ext(path) == "."+from {
5454
paths = append(paths, path)
5555
}

0 commit comments

Comments
 (0)