nonZeroCount returns the amount of values that are non-zero.
(values ...T)
| 375 | |
| 376 | // nonZeroCount returns the amount of values that are non-zero. |
| 377 | func nonZeroCount[T comparable](values ...T) int { |
| 378 | count := 0 |
| 379 | var zero T |
| 380 | for _, value := range values { |
| 381 | if value != zero { |
| 382 | count++ |
| 383 | } |
| 384 | } |
| 385 | return count |
| 386 | } |
| 387 | |
| 388 | // Validate validates the HTTPClientConfig to check only one of BearerToken, |
| 389 | // BasicAuth and BearerTokenFile is configured. It also validates that ProxyURL |