mirror of
https://github.com/vbatts/dedupe-linker.git
synced 2025-07-27 04:20:28 +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
|
// HasBlob tests whether a blob with this sum exists
|
||||||
func (b Base) HasBlob(sum string) bool {
|
func (b Base) HasBlob(sum string) bool {
|
||||||
fi, err := b.Stat(sum)
|
fi, err := b.Stat(sum)
|
||||||
log.Println("SUCH FARTS", fi)
|
|
||||||
return fi != nil && err == nil
|
return fi != nil && err == nil
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,7 +29,7 @@ func DetermineHash(str string) (h crypto.Hash) {
|
||||||
case "sha512":
|
case "sha512":
|
||||||
h = crypto.SHA512
|
h = crypto.SHA512
|
||||||
default:
|
default:
|
||||||
log.Println("WARNING: unknown cipher %q. using 'sha1'", str)
|
log.Printf("WARNING: unknown cipher %q. using 'sha1'", str)
|
||||||
h = crypto.SHA1
|
h = crypto.SHA1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
2
main.go
2
main.go
|
@ -14,7 +14,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
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)")
|
flCipher = flag.String("c", "sha1", "block cipher to use (sha1, or sha256)")
|
||||||
flWorkers = flag.Int("w", 2, "workers to do summing")
|
flWorkers = flag.Int("w", 2, "workers to do summing")
|
||||||
flNoop = flag.Bool("noop", false, "don't do any moving or linking")
|
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 {
|
func (w Walker) Walk(path string, quit chan int) error {
|
||||||
|
// XXX what is going on here?
|
||||||
select {
|
select {
|
||||||
case <-quit:
|
case <-quit:
|
||||||
return nil
|
close(quit)
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue