From 076a3a40da30c86424c773a12fcb94dd61fc8b67 Mon Sep 17 00:00:00 2001 From: pippellia-btc Date: Fri, 19 Sep 2025 17:50:37 +0200 Subject: [PATCH] error walks.ErrInvalidRemoval contains the correct value by reading it at compile time --- pkg/walks/walks.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/pkg/walks/walks.go b/pkg/walks/walks.go index 632fdea..f9b6d33 100644 --- a/pkg/walks/walks.go +++ b/pkg/walks/walks.go @@ -3,7 +3,6 @@ package walks import ( "context" - "errors" "fmt" "log" "math/rand/v2" @@ -17,7 +16,7 @@ var ( Alpha = 0.85 // the dampening factor N = 100 // the walks per node - ErrInvalidRemoval = errors.New("the walks to be removed are different than the expected number (100)") + ErrInvalidRemoval = fmt.Errorf("the walks to be removed are different than the expected number (%d)", N) ) // ID represent how walks are identified in the storage layer @@ -29,7 +28,6 @@ func (id ID) MarshalBinary() ([]byte, error) { return []byte(id), nil } type Walk struct { ID ID Path []graph.ID - // Stop int } // Len returns the lenght of the walk