fixed struct alignment && refactor linter (#369)
All checks were successful
test / test (push) Successful in 42s
All checks were successful
test / test (push) Successful in 42s
## Pull Request template Please, go through these steps before clicking submit on this PR. 1. Give a descriptive title to your PR. 2. Provide a description of your changes. 3. Make sure you have some relevant tests. 4. Put `closes #XXXX` in your comment to auto-close the issue that your PR fixes (if applicable). **PLEASE REMOVE THIS TEMPLATE BEFORE SUBMITTING** Reviewed-on: #369 Co-authored-by: Evstigneev Denis <danteevstigneev@yandex.ru> Co-committed-by: Evstigneev Denis <danteevstigneev@yandex.ru>
This commit is contained in:
@@ -109,12 +109,11 @@ func Merge(olist []*register.Service, nlist []*register.Service) []*register.Ser
|
||||
seen = true
|
||||
srv = append(srv, sp)
|
||||
break
|
||||
} else {
|
||||
sp := ®ister.Service{}
|
||||
// make copy
|
||||
*sp = *o
|
||||
srv = append(srv, sp)
|
||||
}
|
||||
sp := ®ister.Service{}
|
||||
// make copy
|
||||
*sp = *o
|
||||
srv = append(srv, sp)
|
||||
}
|
||||
if !seen {
|
||||
srv = append(srv, Copy([]*register.Service{n})...)
|
||||
@@ -153,14 +152,14 @@ func Remove(old, del []*register.Service) []*register.Service {
|
||||
|
||||
// WaitService using register wait for service to appear with min/max interval for check and optional timeout.
|
||||
// Timeout can be 0 to wait infinitive.
|
||||
func WaitService(ctx context.Context, reg register.Register, name string, min time.Duration, max time.Duration, timeout time.Duration, opts ...register.LookupOption) error {
|
||||
func WaitService(ctx context.Context, reg register.Register, name string, minTime time.Duration, maxTime time.Duration, timeout time.Duration, opts ...register.LookupOption) error {
|
||||
if timeout > 0 {
|
||||
var cancel context.CancelFunc
|
||||
ctx, cancel = context.WithTimeout(ctx, timeout)
|
||||
defer cancel()
|
||||
}
|
||||
|
||||
ticker := jitter.NewTickerContext(ctx, min, max)
|
||||
ticker := jitter.NewTickerContext(ctx, minTime, maxTime)
|
||||
defer ticker.Stop()
|
||||
|
||||
for {
|
||||
|
Reference in New Issue
Block a user