Skip to content

Commit

Permalink
Merge pull request #279 from atc0005/i278-refactor-parse-range-string
Browse files Browse the repository at this point in the history
Minor refactoring of ParseRangeString func
  • Loading branch information
atc0005 authored Oct 25, 2024
2 parents e522aeb + 8aee5ff commit a1f2e80
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions range.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,17 +97,17 @@ func ParseRangeString(input string) *Range {
return nil
}

switch {
// Invert the range.
//
// i.e. @10:20 means ≥ 10 and ≤ 20 (inside the range of {10 .. 20}
// inclusive)
if strings.HasPrefix(input, "@") {
case strings.HasPrefix(input, "@"):
r.AlertOn = "INSIDE"
input = input[1:]
}

// ~ represents infinity
if strings.HasPrefix(input, "~") {
case strings.HasPrefix(input, "~"):
r.StartInfinity = true
input = input[1:]
}
Expand Down

0 comments on commit a1f2e80

Please sign in to comment.