Skip to content

Commit 9c95e02

Browse files
author
en-ken
committed
refactor: changed main dir.
1 parent cee4538 commit 9c95e02

File tree

4 files changed

+10
-9
lines changed

4 files changed

+10
-9
lines changed

kadai2/en-ken/cli.go renamed to kadai2/en-ken/cli/cli.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package main
1+
package cli
22

33
import (
44
"flag"
@@ -10,8 +10,8 @@ import (
1010

1111
// CLI is for DI
1212
type CLI struct {
13-
dirPath imgcnv.DirPath
14-
imageFactory imgcnv.ImageFileFactory
13+
DirPath imgcnv.DirPath
14+
ImageFactory imgcnv.ImageFileFactory
1515
}
1616

1717
// Execute executes this app according to options
@@ -43,13 +43,13 @@ func (cli *CLI) Execute(args []string) error {
4343
outputDir = inputDir
4444
}
4545

46-
paths, err := cli.dirPath.AllFilePaths(inputDir, *inputExt)
46+
paths, err := cli.DirPath.AllFilePaths(inputDir, *inputExt)
4747
if err != nil {
4848
return err
4949
}
5050

5151
for _, path := range paths {
52-
img, err := cli.imageFactory.Create(path)
52+
img, err := cli.ImageFactory.Create(path)
5353
if err != nil {
5454
return err
5555
}

kadai2/en-ken/cli_test.go renamed to kadai2/en-ken/cli/cli_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package main
1+
package cli
22

33
import (
44
"path/filepath"

kadai2/en-ken/main.go renamed to kadai2/en-ken/kadai2/main.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,16 @@ package main
33
import (
44
"os"
55

6+
"github.com/gopherdojo/dojo6/kadai2/en-ken/cli"
67
"github.com/gopherdojo/dojo6/kadai2/en-ken/imgcnv"
78
)
89

910
func main() {
1011
dirPath := imgcnv.NewDirPath()
1112
factory := imgcnv.NewImageFileFactory()
12-
cli := &CLI{
13-
dirPath: dirPath,
14-
imageFactory: factory,
13+
cli := &cli.CLI{
14+
DirPath: dirPath,
15+
ImageFactory: factory,
1516
}
1617

1718
cli.Execute(os.Args)
File renamed without changes.

0 commit comments

Comments
 (0)