|  | @@ -60,6 +60,7 @@ func main() {
 | 
											
												
													
														|  |  		if runtime.GOOS == "windows" {
 |  |  		if runtime.GOOS == "windows" {
 | 
											
												
													
														|  |  			driveLetter = filepath.VolumeName(myFile) + "/"
 |  |  			driveLetter = filepath.VolumeName(myFile) + "/"
 | 
											
												
													
														|  |  		}
 |  |  		}
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  |  		if report != "" {
 |  |  		if report != "" {
 | 
											
												
													
														|  |  			compareFolder(myFile)
 |  |  			compareFolder(myFile)
 | 
											
												
													
														|  |  		} else {
 |  |  		} else {
 | 
											
										
											
												
													
														|  | @@ -90,7 +91,7 @@ func getSha256Hash(fileStr string) string {
 | 
											
												
													
														|  |  var lock1 = sync.RWMutex{}
 |  |  var lock1 = sync.RWMutex{}
 | 
											
												
													
														|  |  var lock2 = sync.RWMutex{}
 |  |  var lock2 = sync.RWMutex{}
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  | -func outputHash(fileStr string) {
 |  | 
 | 
											
												
													
														|  | 
 |  | +func calculateHash(fileStr string) {
 | 
											
												
													
														|  |  	var hashFile Fdhashes
 |  |  	var hashFile Fdhashes
 | 
											
												
													
														|  |  	doHash := true
 |  |  	doHash := true
 | 
											
												
													
														|  |  	dir, fileName := filepath.Split(fileStr)
 |  |  	dir, fileName := filepath.Split(fileStr)
 | 
											
										
											
												
													
														|  | @@ -168,7 +169,7 @@ func processFolder(folder string) {
 | 
											
												
													
														|  |  			}
 |  |  			}
 | 
											
												
													
														|  |  			if !info.IsDir() {
 |  |  			if !info.IsDir() {
 | 
											
												
													
														|  |  				addWork++
 |  |  				addWork++
 | 
											
												
													
														|  | -				outputHash(path)
 |  | 
 | 
											
												
													
														|  | 
 |  | +				calculateHash(path)
 | 
											
												
													
														|  |  				if time.Since(startTime).Seconds() > 10.0 {
 |  |  				if time.Since(startTime).Seconds() > 10.0 {
 | 
											
												
													
														|  |  					startTime = time.Now()
 |  |  					startTime = time.Now()
 | 
											
												
													
														|  |  					saveAllHashFiles()
 |  |  					saveAllHashFiles()
 | 
											
										
											
												
													
														|  | @@ -310,28 +311,6 @@ func compareFolder(folder string) {
 | 
											
												
													
														|  |  	w.Flush()
 |  |  	w.Flush()
 | 
											
												
													
														|  |  }
 |  |  }
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  | -func compareFolder2(folder string) {
 |  | 
 | 
											
												
													
														|  | -	loadAllHashFiles(folder)
 |  | 
 | 
											
												
													
														|  | -	size := len(hashes)
 |  | 
 | 
											
												
													
														|  | -	f, err := os.Create("report.txt")
 |  | 
 | 
											
												
													
														|  | -	check(err)
 |  | 
 | 
											
												
													
														|  | -	w := bufio.NewWriter(f)
 |  | 
 | 
											
												
													
														|  | -	count := 0
 |  | 
 | 
											
												
													
														|  | -	for _, hashFile := range hashes {
 |  | 
 | 
											
												
													
														|  | -		count++
 |  | 
 | 
											
												
													
														|  | -		fmt.Printf("%d (%d) checking: %s\n", count, size, hashFile.Path)
 |  | 
 | 
											
												
													
														|  | -		//		fmt.Printf("checking: %s\n", hashFile.Path)
 |  | 
 | 
											
												
													
														|  | -		for filename, hash := range hashFile.Hashes {
 |  | 
 | 
											
												
													
														|  | -			if value, found := search(hash, filename, hashFile.Path); found {
 |  | 
 | 
											
												
													
														|  | -				w.WriteString("found identically hash\n")
 |  | 
 | 
											
												
													
														|  | -				w.WriteString(fmt.Sprintf("  src:  %s/%s\n", hashFile.Path, filename))
 |  | 
 | 
											
												
													
														|  | -				w.WriteString(fmt.Sprintf("  dest: %s\n", value))
 |  | 
 | 
											
												
													
														|  | -				w.Flush()
 |  | 
 | 
											
												
													
														|  | -			}
 |  | 
 | 
											
												
													
														|  | -		}
 |  | 
 | 
											
												
													
														|  | -	}
 |  | 
 | 
											
												
													
														|  | -}
 |  | 
 | 
											
												
													
														|  | -
 |  | 
 | 
											
												
													
														|  |  func search(srcHash string, exFilename string, exFilepath string) (value string, found bool) {
 |  |  func search(srcHash string, exFilename string, exFilepath string) (value string, found bool) {
 | 
											
												
													
														|  |  	for _, hashFile := range hashes {
 |  |  	for _, hashFile := range hashes {
 | 
											
												
													
														|  |  		for filename, hash := range hashFile.Hashes {
 |  |  		for filename, hash := range hashFile.Hashes {
 |