mirror of
https://github.com/vbatts/dedupe-linker.git
synced 2025-01-14 09:40:07 +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"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
|
||||||
"../file"
|
"github.com/vbatts/dedupe-linker/cryptomap"
|
||||||
|
"github.com/vbatts/dedupe-linker/file"
|
||||||
)
|
)
|
||||||
|
|
||||||
func NewBase(path string, hashName string) (*Base, error) {
|
func NewBase(path string, hashName string) (*Base, error) {
|
||||||
|
@ -19,7 +20,7 @@ func NewBase(path string, hashName string) (*Base, error) {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return &Base{Path: root, HashName: hashName}, nil
|
return &Base{Path: root, HashName: hashName, Hash: cryptomap.DetermineHash(hashName)}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
type Base struct {
|
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) {
|
if err = b.LinkTo(path.Join(srcDir, "beef1.txt"), rHash); err != nil && !os.IsExist(err) {
|
||||||
t.Error(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"
|
"path/filepath"
|
||||||
"runtime"
|
"runtime"
|
||||||
|
|
||||||
"./base"
|
"github.com/vbatts/dedupe-linker/base"
|
||||||
"./cryptomap"
|
"github.com/vbatts/dedupe-linker/cryptomap"
|
||||||
"./file"
|
"github.com/vbatts/dedupe-linker/file"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
package walker
|
package walker
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"./base"
|
"github.com/vbatts/dedupe-linker/base"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Walker struct {
|
type Walker struct {
|
||||||
|
|
Loading…
Reference in a new issue