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:
parent
afe6182084
commit
9e4d10d2d5
4 changed files with 11 additions and 6 deletions
|
@ -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 {
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
|
6
main.go
6
main.go
|
@ -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 (
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package walker
|
||||
|
||||
import (
|
||||
"./base"
|
||||
"github.com/vbatts/dedupe-linker/base"
|
||||
)
|
||||
|
||||
type Walker struct {
|
||||
|
|
Loading…
Reference in a new issue