diff --git a/kadai2/kadai2-1/kadai2-1.md b/kadai2/kadai2-1/kadai2-1.md new file mode 100644 index 0000000..86a5160 --- /dev/null +++ b/kadai2/kadai2-1/kadai2-1.md @@ -0,0 +1,12 @@ +### io.Readerとio.Writerについて調べてみよう + +#### 標準パッケージでどのように使われているか + +様々な入出力を扱う抽象としてio.Reader,ioWriterのinterfaceが定義されている。 +io.Readerを実装した標準パッケージの構造体としては、例えばos.File(ファイルの読み込み),os.Stdin(標準入力),bytes.Buffer(メモリに蓄えた内容の読み込み),net.conn(ネットワーク通信からの読み込み)が挙げられる。 +また、io.Writerを実装した標準パッケージの構造体としては、例えばos.File(ファイルの書き込み),os.Stdout(標準出力),bytes.Buffer(メモリへの書き込み),net.conn(ネットワーク通信への送信)が挙げられる。 + +#### io.Readerとio.Writerがあることでどういう利点があるのか具体例を挙げて考えてみる + +入力元や出力先に関して、ファイルなのか、標準入力出力なのか、メモリなのか、ネットワーク通信なのか、etc...等様々あるが、それらの切り替えを簡単に行うことができる。 +具体例としては、結果を標準出力に表示していたプログラムをファイル書き出しに仕様変更するときに、os.Stdoutを使用していた箇所をos.Fileに変更する改修を行うというだけ(大枠としては。細かいところでは他にも実装が必要そうな気がする。)で済む。 \ No newline at end of file diff --git a/kadai2/kadai2-2/.gitkeep b/kadai2/kadai2-2/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/kadai2/kadai2-2/README.md b/kadai2/kadai2-2/README.md new file mode 100644 index 0000000..7cab0f0 --- /dev/null +++ b/kadai2/kadai2-2/README.md @@ -0,0 +1,8 @@ +## 課題2-2 + +- テストを書いてみよう + - 1回目の宿題のテストを作ってみて下さい + - テストのしやすさを考えてリファクタリングしてみる + - テストのカバレッジを取ってみる + - テーブル駆動テストを行う + - テストヘルパーを作ってみる \ No newline at end of file diff --git a/kadai2/kadai2-2/doc/imageconverter.html b/kadai2/kadai2-2/doc/imageconverter.html new file mode 100644 index 0000000..d888f50 --- /dev/null +++ b/kadai2/kadai2-2/doc/imageconverter.html @@ -0,0 +1,468 @@ + + + + + + + +
+ ++CommandValidator mainで取得したoptionの検査器 +
+ +type CommandValidator struct{}+ + + + + + + + + + + + + +
func (cv *CommandValidator) ExtValidate(f Format) bool+
+ExtValidate 対象フォーマットならばtrue +
+ + + + + + + + ++Converter 画像ファイル変換器 +
+ +type Converter struct{}+ + + + + + + + + + + + + +
func (c *Converter) Run( + f FileInfo, + inputFormat Format, + outputFormat Format)+
+Run 画像を変換する。対象フォーマットではないファイルは無視する。 +
+ + + + + + + + ++Facade mainからの命令窓口 +
+ +type Facade struct{}+ + + + + + + + + + + + + +
func (f *Facade) Run( + targetPath FilePath, + inputFormat Format, + outputFormat Format)+
+Run Searcherを使ってファイル群を走査、Converterを使ってファイル群を変換処理にかける +
+ + + + + + + + ++FileInfo FilePathを基に、付属情報を取得できる関数が定義された型 +
+ +type FileInfo struct { + Path FilePath +}+ + + + + + + + + + + + + +
func (fi *FileInfo) Ext() string+
+Ext .付き拡張子の文字列を返す +
+ + + + + + +func (fi *FileInfo) Format() Format+
+Format .なし拡張子の文字列を返す +
+ + + + + + + + ++FilePath ファイルパスを表す型 +
+ +type FilePath string+ + + + + + + + + + + + + + + +
+Format ファイルのフォーマットを表す型 +
+ +type Format string+ + + + + + + + + + + + + +
func (f *Format) Ext() string+
+Ext 拡張子を取得する関数 +
+ + + + + + +func (f *Format) NormalizedFormat() Format+
+NormalizedFormat 本ツール内で扱いやすいフォーマットに変換する。(jpeg => jpg をやりたいがための実装) +
+ + + + + + + + ++Searcher 対象ディレクトリファイルの検索器 +
+ +type Searcher struct{}+ + + + + + + + + + + + + +
func (s *Searcher) Run(target FileInfo) []FileInfo+
+Run 対象ディレクトリを再帰的に走査 +
+ + + + + + + + + + + + + + diff --git a/kadai2/kadai2-2/imageConvert.go b/kadai2/kadai2-2/imageConvert.go new file mode 100644 index 0000000..5de2b24 --- /dev/null +++ b/kadai2/kadai2-2/imageConvert.go @@ -0,0 +1,37 @@ +package main + +import ( + "flag" + "fmt" + "os" + + "github.com/gopherdojo/dojo2/kadai2/kadai2-2/imageconverter" +) + +var ( + inExtOpt = flag.String("i", "jpg", "変換対象の画像ファイルの種類") + outExtOpt = flag.String("o", "png", "変換後の画像ファイルの種類") +) + +func main() { + flag.Parse() + if len(flag.Args()) == 0 { + fmt.Fprintf(os.Stderr, "対象パスが指定されていません") + return + } + targetPath := imageconverter.FilePath(flag.Args()[0]) + + inputFormat := imageconverter.Format(*inExtOpt) + outputFormat := imageconverter.Format(*outExtOpt) + + var icCommandValidator imageconverter.CommandValidator + if (!icCommandValidator.ExtValidate(inputFormat)) || (!icCommandValidator.ExtValidate(outputFormat)) { + fmt.Fprintf(os.Stderr, "画像ファイルフォーマットが対応していません") + return + } + + var searcher imageconverter.Searcher + var converter imageconverter.Converter + icFacade := imageconverter.Facade{Searcher: searcher, Converter: converter} + icFacade.Run(targetPath, inputFormat, outputFormat) +} diff --git a/kadai2/kadai2-2/imageconverter/command_validator.go b/kadai2/kadai2-2/imageconverter/command_validator.go new file mode 100644 index 0000000..2875978 --- /dev/null +++ b/kadai2/kadai2-2/imageconverter/command_validator.go @@ -0,0 +1,12 @@ +package imageconverter + +// CommandValidator mainで取得したoptionの検査器 +type CommandValidator struct{} + +// ExtValidate 対象フォーマットならばtrue +func (CommandValidator) ExtValidate(f Format) bool { + if f == Format("jpg") || f == Format("png") { + return true + } + return false +} diff --git a/kadai2/kadai2-2/imageconverter/command_validator_test.go b/kadai2/kadai2-2/imageconverter/command_validator_test.go new file mode 100644 index 0000000..c4bd4bf --- /dev/null +++ b/kadai2/kadai2-2/imageconverter/command_validator_test.go @@ -0,0 +1,27 @@ +package imageconverter_test + +import ( + "testing" + + "github.com/gopherdojo/dojo2/kadai2/kadai2-2/imageconverter" +) + +var cases_CommandValidator_ExtValidate = []struct { + format imageconverter.Format + expected bool +}{ + {imageconverter.Format("jpg"), true}, + {imageconverter.Format("png"), true}, + {imageconverter.Format("hoge"), false}, + {imageconverter.Format("txt"), false}, +} + +func TestCommandValidator_ExtValidate(t *testing.T) { + var cv imageconverter.CommandValidator + for _, c := range cases_CommandValidator_ExtValidate { + result := cv.ExtValidate(c.format) + if result != c.expected { + t.Errorf("ExtValidate failed.") + } + } +} diff --git a/kadai2/kadai2-2/imageconverter/converter.go b/kadai2/kadai2-2/imageconverter/converter.go new file mode 100644 index 0000000..7f2f4ad --- /dev/null +++ b/kadai2/kadai2-2/imageconverter/converter.go @@ -0,0 +1,63 @@ +package imageconverter + +import ( + "fmt" + "image" + "image/jpeg" + "image/png" + "os" + "regexp" +) + +type ConverterInterface interface { + Run(f FileInfo, in, out Format) +} + +// Converter 画像ファイル変換器 +type Converter struct{} + +// Run 画像を変換する。対象フォーマットではないファイルは無視する。 +func (Converter) Run(f FileInfo, in, out Format) { + + fFormat := f.Format() + + if fFormat.NormalizedFormat() != in { + return + } + // 画像を変換する処理 + reg, err := regexp.Compile(`\` + f.Ext() + `$`) + if err != nil { + fmt.Fprintf(os.Stderr, "正規表現解析に失敗しました") + return + } + newPath := reg.ReplaceAllString(string(f.Path), out.Ext()) + fmt.Println(string(f.Path) + " => " + newPath) + + orgFile, err := os.Open(string(f.Path)) + if err != nil { + fmt.Fprintf(os.Stderr, "ファイルが開けません") + return + } + defer orgFile.Close() + + img, _, err := image.Decode(orgFile) + if err != nil { + fmt.Fprintf(os.Stderr, "画像のDecodeに失敗しました") + return + } + + newFile, err := os.Create(newPath) + if err != nil { + fmt.Fprintf(os.Stderr, "画像のDecodeに失敗しました") + return + } + defer newFile.Close() + + switch out { + case "png": + png.Encode(newFile, img) + case "jpg": + jpeg.Encode(newFile, img, nil) + } + +} diff --git a/kadai2/kadai2-2/imageconverter/converter_test.go b/kadai2/kadai2-2/imageconverter/converter_test.go new file mode 100644 index 0000000..d8d69f3 --- /dev/null +++ b/kadai2/kadai2-2/imageconverter/converter_test.go @@ -0,0 +1,79 @@ +package imageconverter_test + +import ( + "os" + "testing" + + "github.com/gopherdojo/dojo2/kadai2/kadai2-2/imageconverter" +) + +func TestConverter_Run(t *testing.T) { + t.Run("jpg to png", func(t *testing.T) { + testConverter_Run(t, + imageconverter.FilePath("../sample_dir1/Octocat.jpeg"), + imageconverter.Format("jpg"), + imageconverter.Format("png"), + imageconverter.FilePath("../sample_dir1/Octocat.png"), + true, + ) + testConverter_Run(t, + imageconverter.FilePath("../sample_dir1/dummy_fuga.md"), + imageconverter.Format("jpg"), + imageconverter.Format("png"), + imageconverter.FilePath("../sample_dir1/dummy_fuga.png"), + false, + ) + testConverter_Run(t, + imageconverter.FilePath("../sample_dir1/sample_dir2/Octocat.jpg"), + imageconverter.Format("jpg"), + imageconverter.Format("png"), + imageconverter.FilePath("../sample_dir1/sample_dir2/Octocat.png"), + true, + ) + }) + t.Run("png to jpg", func(t *testing.T) { + testConverter_Run(t, + imageconverter.FilePath("../sample_dir1/sample_dir2/sample_dir3/Octocat.png"), + imageconverter.Format("png"), + imageconverter.Format("jpg"), + imageconverter.FilePath("../sample_dir1/sample_dir2/sample_dir3/Octocat.jpg"), + true, + ) + testConverter_Run(t, + imageconverter.FilePath("../sample_dir1/dummy_fuga.md"), + imageconverter.Format("png"), + imageconverter.Format("jpg"), + imageconverter.FilePath("../sample_dir1/dummy_fuga.jpg"), + false, + ) + }) +} + +func testConverter_Run(t *testing.T, + inFP imageconverter.FilePath, + inF imageconverter.Format, + outF imageconverter.Format, + expectedOutFP imageconverter.FilePath, + expectedGenerated bool, +) { + t.Helper() + var c imageconverter.Converter + fi := imageconverter.FileInfo{Path: inFP} + c.Run(fi, inF, outF) + result := fileExists(expectedOutFP) + if result != expectedGenerated { + t.Errorf("Converter.Run failed.") + } + if result { + fileClear(expectedOutFP) + } +} + +func fileExists(path imageconverter.FilePath) bool { + _, err := os.Stat(string(path)) + return !os.IsNotExist(err) +} + +func fileClear(path imageconverter.FilePath) { + os.Remove(string(path)) +} diff --git a/kadai2/kadai2-2/imageconverter/facade.go b/kadai2/kadai2-2/imageconverter/facade.go new file mode 100644 index 0000000..ed1b98d --- /dev/null +++ b/kadai2/kadai2-2/imageconverter/facade.go @@ -0,0 +1,15 @@ +package imageconverter + +// Facade mainからの命令窓口 +type Facade struct { + Searcher SearcherInterface + Converter ConverterInterface +} + +// Run Searcherを使ってファイル群を走査、Converterを使ってファイル群を変換処理にかける +func (f *Facade) Run(targetPath FilePath, in, out Format) { + fileInfoList := f.Searcher.Run(FileInfo{Path: targetPath}) + for _, fileInfo := range fileInfoList { + f.Converter.Run(fileInfo, in, out) + } +} diff --git a/kadai2/kadai2-2/imageconverter/facade_test.go b/kadai2/kadai2-2/imageconverter/facade_test.go new file mode 100644 index 0000000..a164914 --- /dev/null +++ b/kadai2/kadai2-2/imageconverter/facade_test.go @@ -0,0 +1,51 @@ +package imageconverter_test + +import ( + "testing" + + "github.com/gopherdojo/dojo2/kadai2/kadai2-2/imageconverter" +) + +var ( + calledCountSearcherRun int + calledCountConverterRun int +) + +type SearcherMock struct{} + +func (SearcherMock) Run(target imageconverter.FileInfo) []imageconverter.FileInfo { + calledCountSearcherRun += 1 + fis := []imageconverter.FileInfo{ + imageconverter.FileInfo{Path: imageconverter.FilePath("../sample_dir1/Octocat.jpeg")}, + imageconverter.FileInfo{Path: imageconverter.FilePath("../sample_dir1/dummy_fuga.md")}, + imageconverter.FileInfo{Path: imageconverter.FilePath("../sample_dir1/dummy_hoge.txt")}, + } + return fis +} + +type ConverterMock struct{} + +func (ConverterMock) Run(f imageconverter.FileInfo, in, out imageconverter.Format) { + calledCountConverterRun += 1 + return +} + +func TestFacade_Run(t *testing.T) { + var searcher SearcherMock + var converter ConverterMock + + targetPath := imageconverter.FilePath("../sample_dir1") + inputFormat := imageconverter.Format("jpg") + outputFormat := imageconverter.Format("png") + + facade := imageconverter.Facade{Searcher: searcher, Converter: converter} + facade.Run(targetPath, inputFormat, outputFormat) + + if calledCountSearcherRun != 1 { + t.Errorf("Facade Run called count is wrong.") + } + if calledCountConverterRun != 3 { + t.Errorf("Facade Run called count is wrong.") + } + +} diff --git a/kadai2/kadai2-2/imageconverter/file_info.go b/kadai2/kadai2-2/imageconverter/file_info.go new file mode 100644 index 0000000..8fc3731 --- /dev/null +++ b/kadai2/kadai2-2/imageconverter/file_info.go @@ -0,0 +1,18 @@ +package imageconverter + +import "path/filepath" + +// FileInfo FilePathを基に、付属情報を取得できる関数が定義された型 +type FileInfo struct { + Path FilePath +} + +// Ext .付き拡張子の文字列を返す +func (fi *FileInfo) Ext() string { + return filepath.Ext(string(fi.Path)) +} + +// Format .なし拡張子の文字列を返す +func (fi *FileInfo) Format() Format { + return Format(fi.Ext()[1:]) +} diff --git a/kadai2/kadai2-2/imageconverter/file_info_test.go b/kadai2/kadai2-2/imageconverter/file_info_test.go new file mode 100644 index 0000000..1e52fc4 --- /dev/null +++ b/kadai2/kadai2-2/imageconverter/file_info_test.go @@ -0,0 +1,25 @@ +package imageconverter_test + +import ( + "testing" + + "github.com/gopherdojo/dojo2/kadai2/kadai2-2/imageconverter" +) + +func TestFileInfo_Ext(t *testing.T) { + fi := imageconverter.FileInfo{Path: imageconverter.FilePath("/path/to/hoge.txt")} + result := fi.Ext() + expected := ".txt" + if result != expected { + t.Errorf("FileInfo.Ext failed. expect:%s, actual:%s", expected, result) + } +} + +func TestFileInfo_Format(t *testing.T) { + fi := imageconverter.FileInfo{Path: imageconverter.FilePath("/path/to/hoge.txt")} + result := fi.Format() + expected := imageconverter.Format("txt") + if result != expected { + t.Errorf("Format failed. expect:%s, actual:%s", expected, result) + } +} diff --git a/kadai2/kadai2-2/imageconverter/file_path.go b/kadai2/kadai2-2/imageconverter/file_path.go new file mode 100644 index 0000000..c54df74 --- /dev/null +++ b/kadai2/kadai2-2/imageconverter/file_path.go @@ -0,0 +1,4 @@ +package imageconverter + +// FilePath ファイルパスを表す型 +type FilePath string diff --git a/kadai2/kadai2-2/imageconverter/format.go b/kadai2/kadai2-2/imageconverter/format.go new file mode 100644 index 0000000..ebe8e38 --- /dev/null +++ b/kadai2/kadai2-2/imageconverter/format.go @@ -0,0 +1,19 @@ +package imageconverter + +// Format ファイルのフォーマットを表す型 +type Format string + +// Ext 拡張子を取得する関数 +func (f *Format) Ext() string { + return `.` + string(*f) +} + +// NormalizedFormat 本ツール内で扱いやすいフォーマットに変換する。(jpeg => jpg をやりたいがための実装) +func (f *Format) NormalizedFormat() Format { + switch string(*f) { + case "jpeg": + return Format("jpg") + default: + return *f + } +} diff --git a/kadai2/kadai2-2/imageconverter/format_test.go b/kadai2/kadai2-2/imageconverter/format_test.go new file mode 100644 index 0000000..d917858 --- /dev/null +++ b/kadai2/kadai2-2/imageconverter/format_test.go @@ -0,0 +1,34 @@ +package imageconverter_test + +import ( + "testing" + + "github.com/gopherdojo/dojo2/kadai2/kadai2-2/imageconverter" +) + +func TestFormat_Ext(t *testing.T) { + f := imageconverter.Format("hoge") + result := f.Ext() + expected := ".hoge" + if result != expected { + t.Errorf("Format.Ext failed. expect:%s, actual:%s", expected, result) + } +} + +var cases_Format_NormalizedFormat = []struct { + format imageconverter.Format + expected imageconverter.Format +}{ + {imageconverter.Format("jpeg"), imageconverter.Format("jpg")}, + {imageconverter.Format("jpg"), imageconverter.Format("jpg")}, + {imageconverter.Format("png"), imageconverter.Format("png")}, +} + +func TestFormat_NormalizedFormat(t *testing.T) { + for _, c := range cases_Format_NormalizedFormat { + result := c.format.NormalizedFormat() + if result != c.expected { + t.Errorf("NormalizedFormat failed. expect:%s, actual:%s", c.expected, result) + } + } +} diff --git a/kadai2/kadai2-2/imageconverter/searcher.go b/kadai2/kadai2-2/imageconverter/searcher.go new file mode 100644 index 0000000..1f79b1e --- /dev/null +++ b/kadai2/kadai2-2/imageconverter/searcher.go @@ -0,0 +1,30 @@ +package imageconverter + +import ( + "fmt" + "os" + "path/filepath" +) + +type SearcherInterface interface { + Run(target FileInfo) []FileInfo +} + +// Searcher 対象ディレクトリファイルの検索器 +type Searcher struct{} + +// Run 対象ディレクトリを再帰的に走査 +func (Searcher) Run(target FileInfo) []FileInfo { + var fis []FileInfo + err := filepath.Walk(string(target.Path), func(path string, info os.FileInfo, err error) error { + if !info.IsDir() { + fis = append(fis, FileInfo{Path: FilePath(path)}) + } + return nil + }) + if err != nil { + fmt.Fprintf(os.Stderr, "ディレクトリ検索の途中でエラーが発生しました") + return fis + } + return fis +} diff --git a/kadai2/kadai2-2/imageconverter/searcher_test.go b/kadai2/kadai2-2/imageconverter/searcher_test.go new file mode 100644 index 0000000..cf4b46e --- /dev/null +++ b/kadai2/kadai2-2/imageconverter/searcher_test.go @@ -0,0 +1,28 @@ +package imageconverter_test + +import ( + "reflect" + "testing" + + "github.com/gopherdojo/dojo2/kadai2/kadai2-2/imageconverter" +) + +func TestSearcher_Run(t *testing.T) { + var searcher imageconverter.Searcher + result := searcher.Run(imageconverter.FileInfo{Path: imageconverter.FilePath("../sample_dir1")}) + expected := []imageconverter.FileInfo{ + imageconverter.FileInfo{Path: imageconverter.FilePath("../sample_dir1/Octocat.jpeg")}, + imageconverter.FileInfo{Path: imageconverter.FilePath("../sample_dir1/dummy_fuga.md")}, + imageconverter.FileInfo{Path: imageconverter.FilePath("../sample_dir1/dummy_hoge.txt")}, + imageconverter.FileInfo{Path: imageconverter.FilePath("../sample_dir1/sample_dir2/Octocat.jpg")}, + imageconverter.FileInfo{Path: imageconverter.FilePath("../sample_dir1/sample_dir2/dummy_fuga.md")}, + imageconverter.FileInfo{Path: imageconverter.FilePath("../sample_dir1/sample_dir2/dummy_hoge.txt")}, + imageconverter.FileInfo{Path: imageconverter.FilePath("../sample_dir1/sample_dir2/sample_dir3/Octocat.png")}, + imageconverter.FileInfo{Path: imageconverter.FilePath("../sample_dir1/sample_dir2/sample_dir3/dummy_fuga.md")}, + imageconverter.FileInfo{Path: imageconverter.FilePath("../sample_dir1/sample_dir2/sample_dir3/dummy_hoge.txt")}, + } + if !reflect.DeepEqual(result, expected) { + t.Errorf("Run(../sample_dir1) failed. expect:%s, actual:%s", expected, result) + } + +} diff --git a/kadai2/kadai2-2/profile b/kadai2/kadai2-2/profile new file mode 100644 index 0000000..bae2a0b --- /dev/null +++ b/kadai2/kadai2-2/profile @@ -0,0 +1,32 @@ +mode: set +github.com/gopherdojo/dojo2/kadai2/kadai2-2/imageconverter/command_validator.go:7.52,8.46 1 1 +github.com/gopherdojo/dojo2/kadai2/kadai2-2/imageconverter/command_validator.go:11.2,11.14 1 1 +github.com/gopherdojo/dojo2/kadai2/kadai2-2/imageconverter/command_validator.go:8.46,10.3 1 1 +github.com/gopherdojo/dojo2/kadai2/kadai2-2/imageconverter/converter.go:20.50,24.38 2 1 +github.com/gopherdojo/dojo2/kadai2/kadai2-2/imageconverter/converter.go:28.2,29.16 2 1 +github.com/gopherdojo/dojo2/kadai2/kadai2-2/imageconverter/converter.go:33.2,37.16 4 1 +github.com/gopherdojo/dojo2/kadai2/kadai2-2/imageconverter/converter.go:41.2,44.16 3 1 +github.com/gopherdojo/dojo2/kadai2/kadai2-2/imageconverter/converter.go:49.2,50.16 2 1 +github.com/gopherdojo/dojo2/kadai2/kadai2-2/imageconverter/converter.go:54.2,56.13 2 1 +github.com/gopherdojo/dojo2/kadai2/kadai2-2/imageconverter/converter.go:24.38,26.3 1 1 +github.com/gopherdojo/dojo2/kadai2/kadai2-2/imageconverter/converter.go:29.16,32.3 2 0 +github.com/gopherdojo/dojo2/kadai2/kadai2-2/imageconverter/converter.go:37.16,40.3 2 0 +github.com/gopherdojo/dojo2/kadai2/kadai2-2/imageconverter/converter.go:44.16,47.3 2 0 +github.com/gopherdojo/dojo2/kadai2/kadai2-2/imageconverter/converter.go:50.16,53.3 2 0 +github.com/gopherdojo/dojo2/kadai2/kadai2-2/imageconverter/converter.go:57.13,58.27 1 1 +github.com/gopherdojo/dojo2/kadai2/kadai2-2/imageconverter/converter.go:59.13,60.33 1 1 +github.com/gopherdojo/dojo2/kadai2/kadai2-2/imageconverter/facade.go:10.59,12.40 2 1 +github.com/gopherdojo/dojo2/kadai2/kadai2-2/imageconverter/facade.go:12.40,14.3 1 1 +github.com/gopherdojo/dojo2/kadai2/kadai2-2/imageconverter/file_info.go:11.34,13.2 1 1 +github.com/gopherdojo/dojo2/kadai2/kadai2-2/imageconverter/file_info.go:16.37,18.2 1 1 +github.com/gopherdojo/dojo2/kadai2/kadai2-2/imageconverter/format.go:7.31,9.2 1 1 +github.com/gopherdojo/dojo2/kadai2/kadai2-2/imageconverter/format.go:12.44,13.20 1 1 +github.com/gopherdojo/dojo2/kadai2/kadai2-2/imageconverter/format.go:14.14,15.23 1 1 +github.com/gopherdojo/dojo2/kadai2/kadai2-2/imageconverter/format.go:16.10,17.12 1 1 +github.com/gopherdojo/dojo2/kadai2/kadai2-2/imageconverter/searcher.go:17.49,19.97 2 1 +github.com/gopherdojo/dojo2/kadai2/kadai2-2/imageconverter/searcher.go:25.2,25.16 1 1 +github.com/gopherdojo/dojo2/kadai2/kadai2-2/imageconverter/searcher.go:29.2,29.12 1 1 +github.com/gopherdojo/dojo2/kadai2/kadai2-2/imageconverter/searcher.go:19.97,20.20 1 1 +github.com/gopherdojo/dojo2/kadai2/kadai2-2/imageconverter/searcher.go:23.3,23.13 1 1 +github.com/gopherdojo/dojo2/kadai2/kadai2-2/imageconverter/searcher.go:20.20,22.4 1 1 +github.com/gopherdojo/dojo2/kadai2/kadai2-2/imageconverter/searcher.go:25.16,28.3 2 0 diff --git a/kadai2/kadai2-2/sample_dir1/Octocat.jpeg b/kadai2/kadai2-2/sample_dir1/Octocat.jpeg new file mode 100644 index 0000000..ff4ca31 Binary files /dev/null and b/kadai2/kadai2-2/sample_dir1/Octocat.jpeg differ diff --git a/kadai2/kadai2-2/sample_dir1/dummy_fuga.md b/kadai2/kadai2-2/sample_dir1/dummy_fuga.md new file mode 100644 index 0000000..e69de29 diff --git a/kadai2/kadai2-2/sample_dir1/dummy_hoge.txt b/kadai2/kadai2-2/sample_dir1/dummy_hoge.txt new file mode 100644 index 0000000..e69de29 diff --git a/kadai2/kadai2-2/sample_dir1/sample_dir2/Octocat.jpg b/kadai2/kadai2-2/sample_dir1/sample_dir2/Octocat.jpg new file mode 100644 index 0000000..ff4ca31 Binary files /dev/null and b/kadai2/kadai2-2/sample_dir1/sample_dir2/Octocat.jpg differ diff --git a/kadai2/kadai2-2/sample_dir1/sample_dir2/dummy_fuga.md b/kadai2/kadai2-2/sample_dir1/sample_dir2/dummy_fuga.md new file mode 100644 index 0000000..e69de29 diff --git a/kadai2/kadai2-2/sample_dir1/sample_dir2/dummy_hoge.txt b/kadai2/kadai2-2/sample_dir1/sample_dir2/dummy_hoge.txt new file mode 100644 index 0000000..e69de29 diff --git a/kadai2/kadai2-2/sample_dir1/sample_dir2/sample_dir3/Octocat.png b/kadai2/kadai2-2/sample_dir1/sample_dir2/sample_dir3/Octocat.png new file mode 100644 index 0000000..91057da Binary files /dev/null and b/kadai2/kadai2-2/sample_dir1/sample_dir2/sample_dir3/Octocat.png differ diff --git a/kadai2/kadai2-2/sample_dir1/sample_dir2/sample_dir3/dummy_fuga.md b/kadai2/kadai2-2/sample_dir1/sample_dir2/sample_dir3/dummy_fuga.md new file mode 100644 index 0000000..e69de29 diff --git a/kadai2/kadai2-2/sample_dir1/sample_dir2/sample_dir3/dummy_hoge.txt b/kadai2/kadai2-2/sample_dir1/sample_dir2/sample_dir3/dummy_hoge.txt new file mode 100644 index 0000000..e69de29