Skip to content

Commit 12fe8ae

Browse files
committed
Make lintiar happy
1 parent 33e9ada commit 12fe8ae

File tree

3 files changed

+16
-12
lines changed

3 files changed

+16
-12
lines changed

internal/conn/conn.go

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,17 @@ func (c *conn) GetState() (s State) {
177177
return State(c.state.Load())
178178
}
179179

180+
func makeDialOption(overrideHost string) []grpc.DialOption {
181+
dialOption := []grpc.DialOption{
182+
grpc.WithStatsHandler(statsHandler{}),
183+
}
184+
185+
if len(overrideHost) != 0 {
186+
dialOption = append(dialOption, grpc.WithAuthority(overrideHost))
187+
}
188+
return dialOption
189+
}
190+
180191
func (c *conn) realConn(ctx context.Context) (cc *grpc.ClientConn, err error) {
181192
if c.isClosed() {
182193
return nil, xerrors.WithStackTrace(errClosedConnection)
@@ -207,15 +218,8 @@ func (c *conn) realConn(ctx context.Context) (cc *grpc.ClientConn, err error) {
207218
// prepend "ydb" scheme for grpc dns-resolver to find the proper scheme
208219
// three slashes in "ydb:///" is ok. It needs for good parse scheme in grpc resolver.
209220
address := "ydb:///" + c.endpoint.Address()
210-
overrideHost := c.endpoint.OverrideHost()
211-
212-
dialOption := []grpc.DialOption{
213-
grpc.WithStatsHandler(statsHandler{}),
214-
}
215221

216-
if len(overrideHost) != 0 {
217-
dialOption = append(dialOption, grpc.WithAuthority(overrideHost))
218-
}
222+
dialOption := makeDialOption(c.endpoint.OverrideHost())
219223

220224
cc, err = grpc.DialContext(ctx, address, append( //nolint:staticcheck,nolintlint
221225
dialOption,

internal/discovery/discovery.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@ func discover(
8181
endpoint.WithLocalDC(e.GetLocation() == location),
8282
endpoint.WithServices(e.GetService()),
8383
endpoint.WithLastUpdated(config.Clock().Now()),
84-
endpoint.WithIpV4(e.GetIpV4()),
85-
endpoint.WithIpV6(e.GetIpV6()),
84+
endpoint.WithIPV4(e.GetIpV4()),
85+
endpoint.WithIPV6(e.GetIpV6()),
8686
endpoint.WithSslTargetNameOverride(e.GetSslTargetNameOverride()),
8787
))
8888
}

internal/endpoint/endpoint.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,13 +209,13 @@ func WithLastUpdated(ts time.Time) Option {
209209
}
210210
}
211211

212-
func WithIpV4(ipv4 []string) Option {
212+
func WithIPV4(ipv4 []string) Option {
213213
return func(e *endpoint) {
214214
e.ipv4 = append(e.ipv4, ipv4...)
215215
}
216216
}
217217

218-
func WithIpV6(ipv6 []string) Option {
218+
func WithIPV6(ipv6 []string) Option {
219219
return func(e *endpoint) {
220220
e.ipv6 = append(e.ipv6, ipv6...)
221221
}

0 commit comments

Comments
 (0)