1
0
Fork 0
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:
Vincent Batts 2016-09-08 10:48:40 -04:00
parent 2dadf80440
commit 71720092db
Signed by: vbatts
GPG key ID: 10937E57733F1362
4 changed files with 4 additions and 5 deletions

View file

@ -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
}

View file

@ -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
}

View file

@ -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")

View file

@ -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
}