Skip to content

Commit

Permalink
style: format code with Gofumpt and Prettier
Browse files Browse the repository at this point in the history
This commit fixes the style issues introduced in b1de169 according to the output
from Gofumpt and Prettier.

Details: #1771
  • Loading branch information
deepsource-autofix[bot] authored Oct 31, 2024
1 parent 50f28b4 commit 8be99a1
Showing 1 changed file with 30 additions and 30 deletions.
60 changes: 30 additions & 30 deletions internal/client/v1/client/discoverer/discover.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,43 +98,43 @@ func (c *client) Start(ctx context.Context) (<-chan error, error) {
}
}

addrs, err :=c.updateDiscoveryInfo(ctx)
addrs, err := c.updateDiscoveryInfo(ctx)
if err != nil || len(addrs) == 0 {
addrs, err = c.dnsDiscovery(ctx)
if err != nil {
return nil, err
}
addrs, err = c.dnsDiscovery(ctx)
if err != nil {
return nil, err
}
}

var aech <-chan error
if c.client == nil {
c.client = grpc.New(
append(
c.opts,
grpc.WithAddrs(addrs...),
grpc.WithErrGroup(c.eg),
)...,
)
aech, err = c.client.StartConnectionMonitor(ctx)
if err != nil {
return nil, err
}
c.client = grpc.New(
append(
c.opts,
grpc.WithAddrs(addrs...),
grpc.WithErrGroup(c.eg),
)...,
)
aech, err = c.client.StartConnectionMonitor(ctx)
if err != nil {
return nil, err
}
for _, addr := range addrs {
if c.onConnect != nil {
err = c.onConnect(ctx, c, addr)
if err != nil {
return nil, err
}
}
if c.onConnect != nil {
err = c.onConnect(ctx, c, addr)
if err != nil {
return nil, err
}
}
}
} else {
for _, addr := range addrs {
err = c.connect(ctx, addr)
err = c.connect(ctx, addr)
if err != nil {
return nil, err
}
}
aech, err = c.client.StartConnectionMonitor(ctx)
aech, err = c.client.StartConnectionMonitor(ctx)
}
if err != nil {
return nil, err
Expand Down Expand Up @@ -399,12 +399,12 @@ func (c *client) discoverAddrs(
len(node.GetPods().GetPods()) > i &&
len(node.GetPods().GetPods()[i].GetIp()) != 0 {
addr := net.JoinHostPort(node.GetPods().GetPods()[i].GetIp(), uint16(c.port))
if err = c.connect(ctx, addr); err != nil {
log.Debugf("resource based discovery connect from discoverer API for addr = %s failed %v", addr, errors.ErrAddrCouldNotDiscover(err, addr))
err = nil
} else {
addrs = append(addrs, addr)
}
if err = c.connect(ctx, addr); err != nil {
log.Debugf("resource based discovery connect from discoverer API for addr = %s failed %v", addr, errors.ErrAddrCouldNotDiscover(err, addr))
err = nil
} else {
addrs = append(addrs, addr)
}

}
}
Expand Down

0 comments on commit 8be99a1

Please sign in to comment.