1
0
Fork 0
mirror of https://github.com/vbatts/dedupe-linker.git synced 2024-11-15 21:28:37 +00:00

*: general updates

This commit is contained in:
Vincent Batts 2016-07-18 11:23:33 -04:00
parent afe6182084
commit 9e4d10d2d5
4 changed files with 11 additions and 6 deletions

View file

@ -9,7 +9,8 @@ import (
"os"
"path/filepath"
"../file"
"github.com/vbatts/dedupe-linker/cryptomap"
"github.com/vbatts/dedupe-linker/file"
)
func NewBase(path string, hashName string) (*Base, error) {
@ -19,7 +20,7 @@ func NewBase(path string, hashName string) (*Base, error) {
return nil, err
}
}
return &Base{Path: root, HashName: hashName}, nil
return &Base{Path: root, HashName: hashName, Hash: cryptomap.DetermineHash(hashName)}, nil
}
type Base struct {

View file

@ -63,4 +63,8 @@ func TestGetPut(t *testing.T) {
if err = b.LinkTo(path.Join(srcDir, "beef1.txt"), rHash); err != nil && !os.IsExist(err) {
t.Error(err)
}
if rHash != sum {
t.Errorf("expected %s; got %s", rHash, sum)
}
}

View file

@ -8,9 +8,9 @@ import (
"path/filepath"
"runtime"
"./base"
"./cryptomap"
"./file"
"github.com/vbatts/dedupe-linker/base"
"github.com/vbatts/dedupe-linker/cryptomap"
"github.com/vbatts/dedupe-linker/file"
)
var (

View file

@ -1,7 +1,7 @@
package walker
import (
"./base"
"github.com/vbatts/dedupe-linker/base"
)
type Walker struct {