mirror of
https://github.com/vbatts/dedupe-linker.git
synced 2024-12-27 00:56:31 +00:00
*: fixup and go vet
Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
This commit is contained in:
parent
2dadf80440
commit
71720092db
4 changed files with 4 additions and 5 deletions
|
@ -145,6 +145,5 @@ func (b Base) LinkTo(dest, sum string) error {
|
|||
// HasBlob tests whether a blob with this sum exists
|
||||
func (b Base) HasBlob(sum string) bool {
|
||||
fi, err := b.Stat(sum)
|
||||
log.Println("SUCH FARTS", fi)
|
||||
return fi != nil && err == nil
|
||||
}
|
||||
|
|
|
@ -29,7 +29,7 @@ func DetermineHash(str string) (h crypto.Hash) {
|
|||
case "sha512":
|
||||
h = crypto.SHA512
|
||||
default:
|
||||
log.Println("WARNING: unknown cipher %q. using 'sha1'", str)
|
||||
log.Printf("WARNING: unknown cipher %q. using 'sha1'", str)
|
||||
h = crypto.SHA1
|
||||
}
|
||||
|
||||
|
|
2
main.go
2
main.go
|
@ -14,7 +14,7 @@ import (
|
|||
)
|
||||
|
||||
var (
|
||||
flVarBase = flag.String("b", filepath.Join(os.Getenv("HOME"), "var"), "base directory where files are duplicated")
|
||||
flVarBase = flag.String("b", filepath.Join(os.Getenv("HOME"), ".local/dedupe-linker/var"), "base directory where files are duplicated")
|
||||
flCipher = flag.String("c", "sha1", "block cipher to use (sha1, or sha256)")
|
||||
flWorkers = flag.Int("w", 2, "workers to do summing")
|
||||
flNoop = flag.Bool("noop", false, "don't do any moving or linking")
|
||||
|
|
|
@ -9,10 +9,10 @@ type Walker struct {
|
|||
}
|
||||
|
||||
func (w Walker) Walk(path string, quit chan int) error {
|
||||
|
||||
// XXX what is going on here?
|
||||
select {
|
||||
case <-quit:
|
||||
return nil
|
||||
close(quit)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue