+ log.Fatalln("no common hashes found for:", f.Name)
+ HashFound:
+ fullPath := toCheck[f.Name]
+ if !(len(toCheck) == 0 || fullPath != "") {
+ continue
+ }
+ if fullPath == "" {
+ fullPath = f.Name
+ }
+ fd, err := os.Open(fullPath)
+ if err != nil {
+ fmt.Println("Error:", f.Name, err)
+ bad = true
+ continue
+ }
+ hasher.Start()
+ _, err = io.Copy(hasher, bufio.NewReaderSize(fd, 1<<20))
+ fd.Close()
+ sums := hasher.Sums()
+ if err != nil {
+ fmt.Println("Error:", f.Name, err)
+ bad = true
+ continue
+ }
+ hashOur := sums[0].Hash
+ if hashOur == hashTheir {
+ fmt.Println(f.Name, hashName, "good")
+ } else {
+ fmt.Println(
+ "Hash does not match:", f.Name, hashName,
+ "our:", hashOur,
+ "their:", hashTheir,
+ )
+ bad = true
+ continue
+ }