Match reports whether the request matches the expected version. This function is just a helper, better use the Group instead.
(ctx *context.Context, expectedVersion string)
| 92 | // Match reports whether the request matches the expected version. |
| 93 | // This function is just a helper, better use the Group instead. |
| 94 | func Match(ctx *context.Context, expectedVersion string) bool { |
| 95 | validate, err := semver.ParseRange(expectedVersion) |
| 96 | if err != nil { |
| 97 | return false |
| 98 | } |
| 99 | |
| 100 | return matchVersionRange(ctx, validate) |
| 101 | } |
| 102 | |
| 103 | func matchVersionRange(ctx *context.Context, validate semver.Range) bool { |
| 104 | gotVersion := GetVersion(ctx) |
nothing calls this directly
no test coverage detected
searching dependent graphs…