Skip to content

Commit e3bb72e

Browse files
authored
Merge pull request #1039 update golang version to 1.21-1.22
2 parents c6e45cd + f4f2d66 commit e3bb72e

33 files changed

+70
-93
lines changed

.github/workflows/check-codegen.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
strategy:
1515
matrix:
1616
os: [ ubuntu-latest ]
17-
go-version: [1.20.x, 1.21.x]
17+
go-version: [1.21.x, 1.22.x]
1818
runs-on: ${{ matrix.os }}
1919
steps:
2020
- name: Checkout

.github/workflows/tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
strategy:
1515
fail-fast: false
1616
matrix:
17-
go-version: [1.20.x, 1.21.x]
17+
go-version: [1.21.x, 1.22.x]
1818
os: [ubuntu, windows, macOS]
1919
env:
2020
OS: ${{ matrix.os }}-latest
@@ -44,7 +44,7 @@ jobs:
4444
strategy:
4545
fail-fast: false
4646
matrix:
47-
go-version: [1.20.x, 1.21.x]
47+
go-version: [1.21.x, 1.22.x]
4848
ydb-version: [22.5, 23.1, 23.2, 23.3]
4949
services:
5050
ydb:

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
* The minimum version of Go in `ydb-go-sdk` has been raised to `go1.21`
12
* Fixed topic writer infinite reconnections in some cases
23
* Refactored nil on err `internal/grpcwrapper/rawydb/issues.go`, when golangci-lint nilerr enabled
34
* Refactored nil on err `internal/grpcwrapper/rawtopic/describe_topic.go`, when golangci-lint nilerr enabled

examples/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module examples
22

3-
go 1.20
3+
go 1.21
44

55
require (
66
github.com/google/uuid v1.3.0

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/ydb-platform/ydb-go-sdk/v3
22

3-
go 1.20
3+
go 1.21
44

55
require (
66
github.com/golang-jwt/jwt/v4 v4.4.1

internal/background/worker_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ import (
44
"context"
55
"runtime"
66
"sync"
7+
"sync/atomic"
78
"testing"
89
"time"
910

1011
"github.com/stretchr/testify/require"
1112

1213
"github.com/ydb-platform/ydb-go-sdk/v3/internal/empty"
13-
"github.com/ydb-platform/ydb-go-sdk/v3/internal/xatomic"
1414
"github.com/ydb-platform/ydb-go-sdk/v3/internal/xtest"
1515
)
1616

@@ -75,7 +75,7 @@ func TestWorkerClose(t *testing.T) {
7575
w := NewWorker(ctx)
7676

7777
started := make(empty.Chan)
78-
stopped := xatomic.Bool{}
78+
stopped := atomic.Bool{}
7979
w.Start("test", func(innerCtx context.Context) {
8080
close(started)
8181
<-innerCtx.Done()
@@ -101,12 +101,12 @@ func TestWorkerConcurrentStartAndClose(t *testing.T) {
101101

102102
parallel := runtime.GOMAXPROCS(0)
103103

104-
var counter xatomic.Int64
104+
var counter atomic.Int64
105105

106106
ctx := xtest.Context(t)
107107
w := NewWorker(ctx)
108108

109-
stopNewStarts := xatomic.Bool{}
109+
stopNewStarts := atomic.Bool{}
110110
var wgStarters sync.WaitGroup
111111
for i := 0; i < parallel; i++ {
112112
wgStarters.Add(1)

internal/conn/conn.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"context"
55
"fmt"
66
"sync"
7+
"sync/atomic"
78
"time"
89

910
"github.com/ydb-platform/ydb-go-genproto/protos/Ydb"
@@ -16,7 +17,6 @@ import (
1617
"github.com/ydb-platform/ydb-go-sdk/v3/internal/meta"
1718
"github.com/ydb-platform/ydb-go-sdk/v3/internal/response"
1819
"github.com/ydb-platform/ydb-go-sdk/v3/internal/stack"
19-
"github.com/ydb-platform/ydb-go-sdk/v3/internal/xatomic"
2020
"github.com/ydb-platform/ydb-go-sdk/v3/internal/xcontext"
2121
"github.com/ydb-platform/ydb-go-sdk/v3/internal/xerrors"
2222
"github.com/ydb-platform/ydb-go-sdk/v3/trace"
@@ -54,7 +54,7 @@ type conn struct {
5454
done chan struct{}
5555
endpoint endpoint.Endpoint // ro access
5656
closed bool
57-
state xatomic.Uint32
57+
state atomic.Uint32
5858
lastUsage time.Time
5959
onClose []func(*conn)
6060
onTransportErrors []func(ctx context.Context, cc Conn, cause error)
@@ -555,7 +555,7 @@ func getContextMark(ctx context.Context) *modificationMark {
555555
}
556556

557557
type modificationMark struct {
558-
dirty xatomic.Bool
558+
dirty atomic.Bool
559559
}
560560

561561
func (m *modificationMark) canRetry() bool {

internal/table/client_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import (
88
"path"
99
"runtime"
1010
"sync"
11+
"sync/atomic"
1112
"testing"
1213
"time"
1314

@@ -20,7 +21,6 @@ import (
2021

2122
"github.com/ydb-platform/ydb-go-sdk/v3/internal/closer"
2223
"github.com/ydb-platform/ydb-go-sdk/v3/internal/table/config"
23-
"github.com/ydb-platform/ydb-go-sdk/v3/internal/xatomic"
2424
"github.com/ydb-platform/ydb-go-sdk/v3/internal/xcontext"
2525
"github.com/ydb-platform/ydb-go-sdk/v3/internal/xerrors"
2626
"github.com/ydb-platform/ydb-go-sdk/v3/internal/xrand"
@@ -678,7 +678,7 @@ func TestSessionPoolCloseIdleSessions(t *testing.T) {
678678
xtest.TestManyTimes(t, func(t testing.TB) {
679679
var (
680680
idleThreshold = 4 * time.Second
681-
closedCount xatomic.Int64
681+
closedCount atomic.Int64
682682
fakeClock = clockwork.NewFakeClock()
683683
)
684684
p := newClientWithStubBuilder(

internal/table/scanner/result.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ import (
44
"context"
55
"errors"
66
"io"
7+
"sync/atomic"
78

89
"github.com/ydb-platform/ydb-go-genproto/protos/Ydb"
910
"github.com/ydb-platform/ydb-go-genproto/protos/Ydb_TableStats"
1011

11-
"github.com/ydb-platform/ydb-go-sdk/v3/internal/xatomic"
1212
"github.com/ydb-platform/ydb-go-sdk/v3/internal/xerrors"
1313
"github.com/ydb-platform/ydb-go-sdk/v3/internal/xsync"
1414
"github.com/ydb-platform/ydb-go-sdk/v3/table/result"
@@ -20,11 +20,11 @@ var errAlreadyClosed = xerrors.Wrap(errors.New("result closed early"))
2020
type baseResult struct {
2121
scanner
2222

23-
nextResultSetCounter xatomic.Uint64
23+
nextResultSetCounter atomic.Uint64
2424
statsMtx xsync.RWMutex
2525
stats *Ydb_TableStats.QueryStats
2626

27-
closed xatomic.Bool
27+
closed atomic.Bool
2828
}
2929

3030
type streamResult struct {

internal/table/session.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import (
66
"net/url"
77
"strconv"
88
"sync"
9+
"sync/atomic"
910
"time"
1011

1112
"github.com/ydb-platform/ydb-go-genproto/Ydb_Table_V1"
@@ -25,7 +26,6 @@ import (
2526
"github.com/ydb-platform/ydb-go-sdk/v3/internal/table/config"
2627
"github.com/ydb-platform/ydb-go-sdk/v3/internal/table/scanner"
2728
"github.com/ydb-platform/ydb-go-sdk/v3/internal/value"
28-
"github.com/ydb-platform/ydb-go-sdk/v3/internal/xatomic"
2929
"github.com/ydb-platform/ydb-go-sdk/v3/internal/xcontext"
3030
"github.com/ydb-platform/ydb-go-sdk/v3/internal/xerrors"
3131
"github.com/ydb-platform/ydb-go-sdk/v3/retry"
@@ -50,8 +50,8 @@ type session struct {
5050

5151
status table.SessionStatus
5252
statusMtx sync.RWMutex
53-
nodeID xatomic.Uint32
54-
lastUsage xatomic.Int64
53+
nodeID atomic.Uint32
54+
lastUsage atomic.Int64
5555

5656
onClose []func(s *session)
5757
closeOnce sync.Once

0 commit comments

Comments
 (0)