File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
kadai2/tanaka0325/imgconv/cmd/imgconv Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -61,7 +61,7 @@ func main() {
6161 }
6262 }
6363
64- paths , err := getTargetFilenames (dirnames , from )
64+ paths , err := getTargetFilepaths (dirnames , from )
6565 if err != nil {
6666 onExit (err )
6767 }
@@ -110,14 +110,20 @@ func uniq([]string) []string {
110110 return u
111111}
112112
113- func getTargetFilenames (ds []string , ext string ) ([]string , error ) {
113+ func getTargetFilepaths (ds []string , ext string ) ([]string , error ) {
114114 var names []string
115+
115116 for _ , n := range ds {
116117 if err := filepath .Walk (n , func (name string , info os.FileInfo , err error ) error {
118+ if err != nil {
119+ return err
120+ }
121+
117122 if filepath .Ext (name ) == "." + ext {
118123 n := strings .Replace (name , "." + ext , "" , - 1 )
119124 names = append (names , n )
120125 }
126+
121127 return nil
122128 }); err != nil {
123129 return nil , err
You can’t perform that action at this time.
0 commit comments