Skip to content

Commit 281a3f8

Browse files
committed
fix conflicts
1 parent 6f7b6cd commit 281a3f8

File tree

9 files changed

+13
-60
lines changed

9 files changed

+13
-60
lines changed

internal/allocator/allocator.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,7 @@ type structAllocator struct {
394394

395395
func (a *structAllocator) Struct() (v *Ydb.StructType) {
396396
v = structPool.Get()
397-
if cap(v.Members) <= 0 {
397+
if cap(v.GetMembers()) <= 0 {
398398
v.Members = make([]*Ydb.StructMember, 0, 10) //nolint:gomnd
399399
}
400400
a.allocations = append(a.allocations, v)

internal/cmd/gtrace/main.go

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,6 @@ import (
2020
"github.com/ydb-platform/ydb-go-sdk/v3/internal/xerrors"
2121
)
2222

23-
const (
24-
noTags = 0
25-
oneTag = 1
26-
twoTags = 2
27-
)
28-
29-
//go:linkname build_goodOSArchFile go/build.(*Context).goodOSArchFile
30-
//nolint:revive
31-
func build_goodOSArchFile(*build.Context, string, map[string]bool) bool
32-
3323
//nolint:gocyclo
3424
func main() {
3525
var (
@@ -318,38 +308,6 @@ func buildFunc(info *types.Info, traces map[string]*Trace, fn *ast.FuncType) (re
318308
)
319309
}
320310

321-
func splitOSArchTags(ctx *build.Context, name string) (base, tags, ext string) {
322-
fileTags := make(map[string]bool)
323-
build_goodOSArchFile(ctx, name, fileTags)
324-
ext = filepath.Ext(name)
325-
switch len(fileTags) {
326-
case noTags: // *
327-
base = strings.TrimSuffix(name, ext)
328-
329-
case oneTag: // *_GOOS or *_GOARCH
330-
i := strings.LastIndexByte(name, '_')
331-
332-
base = name[:i]
333-
tags = strings.TrimSuffix(name[i:], ext)
334-
335-
case twoTags: // *_GOOS_GOARCH
336-
var i int
337-
i = strings.LastIndexByte(name, '_')
338-
i = strings.LastIndexByte(name[:i], '_')
339-
340-
base = name[:i]
341-
tags = strings.TrimSuffix(name[i:], ext)
342-
343-
default:
344-
panic(fmt.Sprintf(
345-
"gtrace: internal error: unexpected number of OS/arch tags: %d",
346-
len(fileTags),
347-
))
348-
}
349-
350-
return
351-
}
352-
353311
type Package struct {
354312
*types.Package
355313

internal/conn/pool.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ func NewPool(ctx context.Context, config Config) *Pool {
246246
}
247247

248248
if ttl := config.ConnectionTTL(); ttl > 0 {
249-
go p.connParker(xcontext.WithoutDeadline(ctx), ttl, ttl/2) //nolint:gomnd
249+
go p.connParker(xcontext.ValueOnly(ctx), ttl, ttl/2) //nolint:gomnd
250250
}
251251

252252
return p

internal/coordination/client.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -336,11 +336,11 @@ func (c *Client) closeSessions(ctx context.Context) {
336336
func defaultCreateSessionConfig() *options.CreateSessionOptions {
337337
return &options.CreateSessionOptions{
338338
Description: "YDB Go SDK",
339-
SessionTimeout: time.Second * 5,
339+
SessionTimeout: time.Second * 5, //nolint:gomnd
340340
SessionStartTimeout: time.Second * 1,
341341
SessionStopTimeout: time.Second * 1,
342-
SessionKeepAliveTimeout: time.Second * 10,
343-
SessionReconnectDelay: time.Millisecond * 500,
342+
SessionKeepAliveTimeout: time.Second * 10, //nolint:gomnd
343+
SessionReconnectDelay: time.Millisecond * 500, //nolint:gomnd
344344
}
345345
}
346346

internal/coordination/session.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ func createSession(
7373
}
7474

7575
func newProtectionKey() []byte {
76-
key := make([]byte, 8)
76+
key := make([]byte, 8) //nolint:gomnd
7777
binary.LittleEndian.PutUint64(key, rand.Uint64()) //nolint:gosec
7878

7979
return key
@@ -120,7 +120,7 @@ func (s *session) newStream(
120120
deadline = s.getLastGoodResponseTime().Add(s.options.SessionTimeout)
121121
} else {
122122
// Large enough to make the loop infinite, small enough to allow the maximum duration value (~290 years).
123-
deadline = time.Now().Add(time.Hour * 24 * 365 * 100)
123+
deadline = time.Now().Add(time.Hour * 24 * 365 * 100) //nolint:gomnd
124124
}
125125

126126
lastChance := false
@@ -230,7 +230,7 @@ func (s *session) mainLoop(path string, sessionStartedChan chan struct{}) {
230230

231231
// Start the loops.
232232
wg := sync.WaitGroup{}
233-
wg.Add(2)
233+
wg.Add(2) //nolint:gomnd
234234
sessionStarted := make(chan *Ydb_Coordination.SessionResponse_SessionStarted, 1)
235235
sessionStopped := make(chan *Ydb_Coordination.SessionResponse_SessionStopped, 1)
236236
startSending := make(chan struct{})

internal/meta/context.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ func WithRequestType(ctx context.Context, requestType string) context.Context {
4040
}
4141

4242
// WithAllowFeatures returns a copy of parent context with allowed client feature
43-
func WithAllowFeatures(ctx context.Context, features []string) context.Context {
43+
func WithAllowFeatures(ctx context.Context, features ...string) context.Context {
4444
kv := make([]string, 0, len(features)*2) //nolint:gomnd
4545
for _, feature := range features {
4646
kv = append(kv, HeaderClientCapabilities, feature)

internal/topic/topicwriterinternal/writer_reconnector.go

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,6 @@ import (
3030
"github.com/ydb-platform/ydb-go-sdk/v3/trace"
3131
)
3232

33-
const (
34-
defaultMaxMessageSize = 50 * 1024 * 1024
35-
defaultMaxQueueLen = 1000
36-
)
37-
3833
var (
3934
errConnTimeout = xerrors.Wrap(errors.New("ydb: connection timeout"))
4035
errStopWriterReconnector = xerrors.Wrap(errors.New("ydb: stop writer reconnector"))
@@ -89,8 +84,8 @@ func newWriterReconnectorConfig(options ...PublicWriterOption) WriterReconnector
8984
},
9085
AutoSetSeqNo: true,
9186
AutoSetCreatedTime: true,
92-
MaxMessageSize: defaultMaxMessageSize,
93-
MaxQueueLen: defaultMaxQueueLen,
87+
MaxMessageSize: 50 * 1024 * 1024, //nolint:gomnd
88+
MaxQueueLen: 1000, //nolint:gomnd
9489
RetrySettings: topic.RetrySettings{
9590
StartTimeout: topic.DefaultStartTimeout,
9691
},

internal/value/value.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2425,7 +2425,7 @@ func ZeroValue(t types.Type) Value {
24252425

24262426
return values
24272427
}()...)
2428-
case *DecimalType:
2428+
case *types.Decimal:
24292429
return DecimalValue([16]byte{}, decimalPrecision, decimalScale)
24302430

24312431
default:

tests/slo/native/query/storage.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ DROP TABLE %s
6666
`
6767

6868
func NewStorage(ctx context.Context, cfg *config.Config, poolSize int) (*Storage, error) {
69-
ctx, cancel := context.WithTimeout(ctx, time.Minute*5)
69+
ctx, cancel := context.WithTimeout(ctx, time.Minute*5) //nolint:gomnd
7070
defer cancel()
7171

7272
db, err := ydb.Open(ctx,

0 commit comments

Comments
 (0)