mirror of
				https://github.com/JaCoB1123/dupe-finder.git
				synced 2025-10-30 18:38:30 +01:00 
			
		
		
		
	Do not export delete-methods
This commit is contained in:
		
							
								
								
									
										10
									
								
								main.go
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								main.go
									
									
									
									
									
								
							| @@ -23,7 +23,7 @@ var moveToFolder = flag.String("move-files", "", "Move files to <path> instead o | |||||||
| var force = flag.Bool("force", false, "Actually delete files. Without this options, the files to be deleted are only printed") | var force = flag.Bool("force", false, "Actually delete files. Without this options, the files to be deleted are only printed") | ||||||
| var verbose = flag.Bool("verbose", false, "Output additional information") | var verbose = flag.Bool("verbose", false, "Output additional information") | ||||||
|  |  | ||||||
| func Delete(path string) { | func delete(path string) { | ||||||
| 	if !*force { | 	if !*force { | ||||||
| 		return | 		return | ||||||
| 	} | 	} | ||||||
| @@ -33,10 +33,10 @@ func Delete(path string) { | |||||||
| 		return | 		return | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
| 	MoveButDontOvewrite(path, *moveToFolder) | 	moveButDontOvewrite(path, *moveToFolder) | ||||||
| } | } | ||||||
|  |  | ||||||
| func MoveButDontOvewrite(path string, targetPath string) { | func moveButDontOvewrite(path string, targetPath string) { | ||||||
| 	num := 0 | 	num := 0 | ||||||
|  |  | ||||||
| 	filename := filepath.Base(path) | 	filename := filepath.Base(path) | ||||||
| @@ -98,7 +98,7 @@ func main() { | |||||||
| 					if strings.HasPrefix(filepath.Clean(file), deleteIn) { | 					if strings.HasPrefix(filepath.Clean(file), deleteIn) { | ||||||
| 						fmt.Println("Would delete ", file) | 						fmt.Println("Would delete ", file) | ||||||
| 						if *force { | 						if *force { | ||||||
| 							Delete(file) | 							delete(file) | ||||||
| 						} | 						} | ||||||
| 					} | 					} | ||||||
| 				} | 				} | ||||||
| @@ -138,7 +138,7 @@ func main() { | |||||||
| 					} | 					} | ||||||
|  |  | ||||||
| 					if *force { | 					if *force { | ||||||
| 						Delete(file) | 						delete(file) | ||||||
| 					} | 					} | ||||||
| 				} | 				} | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user