Skip to content

Commit 5bd6a5d

Browse files
committed
fixed mash.NewMash to mash.New.
1 parent 2271b5d commit 5bd6a5d

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

mash/mash.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ type Mash struct {
5555
Sketches []uint32 // The sketches are the hashes of the kmers that we can compare to other sketches.
5656
}
5757

58-
// NewMash initializes a new mash sketch.
59-
func NewMash(kmerSize int, sketchSize int) *Mash {
58+
// New initializes a new mash sketch.
59+
func New(kmerSize int, sketchSize int) *Mash {
6060
return &Mash{
6161
KmerSize: kmerSize,
6262
SketchSize: sketchSize,

mash/mash_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ import (
77
)
88

99
func TestMash(t *testing.T) {
10-
fingerprint1 := mash.NewMash(17, 10)
10+
fingerprint1 := mash.New(17, 10)
1111
fingerprint1.Sketch("ATGCGATCGATCGATCGATCGATCGATCGATCGATCGATCGATCGATCGATCGATCGATCGA")
1212

13-
fingerprint2 := mash.NewMash(17, 9)
13+
fingerprint2 := mash.New(17, 9)
1414
fingerprint2.Sketch("ATGCGATCGATCGATCGATCGATCGATCGATCGATCGATCGATCGATCGATCGATCGATCGA")
1515

1616
distance := fingerprint1.Distance(fingerprint2)
@@ -23,15 +23,15 @@ func TestMash(t *testing.T) {
2323
t.Errorf("Expected distance to be 0, got %f", distance)
2424
}
2525

26-
spoofedFingerprint := mash.NewMash(17, 10)
26+
spoofedFingerprint := mash.New(17, 10)
2727
spoofedFingerprint.Sketches[0] = 0
2828

2929
distance = fingerprint1.Distance(spoofedFingerprint)
3030
if distance != 1 {
3131
t.Errorf("Expected distance to be 1, got %f", distance)
3232
}
3333

34-
spoofedFingerprint = mash.NewMash(17, 9)
34+
spoofedFingerprint = mash.New(17, 9)
3535

3636
distance = fingerprint1.Distance(spoofedFingerprint)
3737
if distance != 1 {

0 commit comments

Comments
 (0)