*: 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" "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 {

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) { 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)
}
} }

View File

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

View File

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