Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat#116: int with default thresholds #130

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

DrSequence
Copy link

@DrSequence DrSequence commented May 22, 2024

  • added base utils class for int
  • moved from random_int to utils
  • added tests

One problem: possibly the id as it might be negative. Maybe I need to add some constraints for ID type.

Copy link
Contributor

@wwoytenko wwoytenko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider how to overcome the mentioned.

As I understand it resolves #116

@@ -17,7 +18,7 @@ type NoiseTimestampLimiter struct {
func NewNoiseTimestampLimiter(minDate, maxDate *time.Time) (*NoiseTimestampLimiter, error) {

if minDate != nil && maxDate != nil && minDate.After(*maxDate) {
return nil, ErrWrongLimits
return nil, int_utils.ErrWrongLimits
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider adding another import alias, because int_utils contains not only integer utils

}

if minValue == 0 {
minValue = minThreshold
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The 0 value might be received from parameters. Consider the way how to overcome this obstacle. For instance, we would receive the values by pointer and if there is a nil, then set default value thresholds.

Parameterizer interface provides the next method

IsEmpty() (bool, error)

You can check that the value is empty if needed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants