Skip to content

Commit

Permalink
fix: delete unused method and update comment
Browse files Browse the repository at this point in the history
Relates to a related fix done in some other sdks, such as the node one at
Unleash/unleash-client-node#417

In this case, this method appears unused, so we can remove it.
  • Loading branch information
thomasheartman committed Sep 19, 2024
1 parent f544a66 commit 5da64ab
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions internal/strategies/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,6 @@ type rng struct {
random *rand.Rand
}

func (r *rng) int() int {
r.Lock()
n := r.random.Intn(100) + 1
r.Unlock()
return n
}

func (r *rng) float() float64 {
return float64(r.int())

Check failure on line 82 in internal/strategies/helpers.go

View workflow job for this annotation

GitHub Actions / build (1.13)

r.int undefined (type *rng has no field or method int)

Check failure on line 82 in internal/strategies/helpers.go

View workflow job for this annotation

GitHub Actions / build (1.15)

r.int undefined (type *rng has no field or method int)

Check failure on line 82 in internal/strategies/helpers.go

View workflow job for this annotation

GitHub Actions / build (1.16)

r.int undefined (type *rng has no field or method int)

Check failure on line 82 in internal/strategies/helpers.go

View workflow job for this annotation

GitHub Actions / build (1.17)

r.int undefined (type *rng has no field or method int)

Check failure on line 82 in internal/strategies/helpers.go

View workflow job for this annotation

GitHub Actions / build (1.18)

r.int undefined (type *rng has no field or method int)

Check failure on line 82 in internal/strategies/helpers.go

View workflow job for this annotation

GitHub Actions / build (1.19)

r.int undefined (type *rng has no field or method int)

Check failure on line 82 in internal/strategies/helpers.go

View workflow job for this annotation

GitHub Actions / build (1.20)

r.int undefined (type *rng has no field or method int)

Check failure on line 82 in internal/strategies/helpers.go

View workflow job for this annotation

GitHub Actions / build (1.21)

r.int undefined (type *rng has no field or method int)

Check failure on line 82 in internal/strategies/helpers.go

View workflow job for this annotation

GitHub Actions / build (1.22)

r.int undefined (type *rng has no field or method int)
}
Expand All @@ -96,8 +89,8 @@ func (r *rng) string() string {
return strconv.Itoa(n)
}

// newRng creates a new random number generator for numbers between 1-100
// and uses a mutex internally to ensure safe concurrent reads.
// newRng creates a new random number generator and uses a mutex
// internally to ensure safe concurrent reads.
func newRng() *rng {
seed := time.Now().UnixNano() + int64(os.Getpid())
return &rng{random: rand.New(rand.NewSource(seed))}
Expand Down

0 comments on commit 5da64ab

Please sign in to comment.