Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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 a713ffe according to the output
from Gofumpt and Prettier.

Details: #1771
deepsource-autofix[bot] authored Oct 31, 2024
1 parent b1de169 commit 6dfe9a0
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
@@ -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
@@ -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)
}

}
}

0 comments on commit 6dfe9a0

Please sign in to comment.