Skip to content

Commit 5ff11a1

Browse files
authored
fix(v1): replace Russian С to English C in trm.CtxManager type (#126)
* add alias for CtxManager with ascii symbols * set golangci-lint github action to v1.56.2 * change Russian С to English C in comments also
1 parent f57a4ba commit 5ff11a1

12 files changed

Lines changed: 32 additions & 25 deletions

File tree

.github/workflows/main.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,4 +139,6 @@ jobs:
139139
- name: golangci-lint
140140
uses: golangci/golangci-lint-action@v3
141141
with:
142+
# see https://github.com/avito-tech/go-transaction-manager/pull/126#issuecomment-3217011035
143+
version: v1.56.2
142144
args: --timeout=3m -v

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ require (
1818
github.com/pashagolub/pgxmock/v2 v2.12.0
1919
github.com/stretchr/testify v1.8.2
2020
go.mongodb.org/mongo-driver v1.12.2
21-
go.uber.org/goleak v1.3.0 // indirect
21+
go.uber.org/goleak v1.3.0
2222
go.uber.org/multierr v1.9.0
2323
gorm.io/driver/mysql v1.5.2
2424
gorm.io/driver/sqlite v1.5.1

gorm/context.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@ import (
1515
// DefaultCtxGetter is the CtxGetter with settings.DefaultCtxKey.
1616
var DefaultCtxGetter = NewCtxGetter(trmcontext.DefaultManager)
1717

18-
// CtxGetter gets Tr from trm.СtxManager by casting trm.Transaction to *gorm.DB.
18+
// CtxGetter gets Tr from trm.CtxManager by casting trm.Transaction to *gorm.DB.
1919
type CtxGetter struct {
20-
ctxManager trm.СtxManager
20+
ctxManager trm.CtxManager
2121
}
2222

2323
// NewCtxGetter returns *CtxGetter to get *gorm.DB from context.Context.
24-
func NewCtxGetter(c trm.СtxManager) *CtxGetter {
24+
func NewCtxGetter(c trm.CtxManager) *CtxGetter {
2525
return &CtxGetter{ctxManager: c}
2626
}
2727

pgxv4/context.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@ import (
1313
// DefaultCtxGetter is the CtxGetter with settings.DefaultCtxKey.
1414
var DefaultCtxGetter = NewCtxGetter(trmcontext.DefaultManager)
1515

16-
// CtxGetter gets Tr from trm.СtxManager by casting trm.Transaction to Tr.
16+
// CtxGetter gets Tr from trm.CtxManager by casting trm.Transaction to Tr.
1717
type CtxGetter struct {
18-
ctxManager trm.СtxManager
18+
ctxManager trm.CtxManager
1919
}
2020

2121
// NewCtxGetter returns *CtxGetter to get Tr from context.Context.
22-
func NewCtxGetter(c trm.СtxManager) *CtxGetter {
22+
func NewCtxGetter(c trm.CtxManager) *CtxGetter {
2323
return &CtxGetter{ctxManager: c}
2424
}
2525

pgxv5/context.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@ import (
1313
// DefaultCtxGetter is the CtxGetter with settings.DefaultCtxKey.
1414
var DefaultCtxGetter = NewCtxGetter(trmcontext.DefaultManager)
1515

16-
// CtxGetter gets Tr from trm.СtxManager by casting trm.Transaction to Tr.
16+
// CtxGetter gets Tr from trm.CtxManager by casting trm.Transaction to Tr.
1717
type CtxGetter struct {
18-
ctxManager trm.СtxManager
18+
ctxManager trm.CtxManager
1919
}
2020

2121
// NewCtxGetter returns *CtxGetter to get Tr from context.Context.
22-
func NewCtxGetter(c trm.СtxManager) *CtxGetter {
22+
func NewCtxGetter(c trm.CtxManager) *CtxGetter {
2323
return &CtxGetter{ctxManager: c}
2424
}
2525

redis/context.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ import (
1212
// DefaultCtxGetter is the CtxGetter with settings.DefaultCtxKey.
1313
var DefaultCtxGetter = NewCtxGetter(trmcontext.DefaultManager)
1414

15-
// CtxGetter gets redis.Pipeliner from trm.СtxManager by casting trm.Transaction to redis.UniversalClient.
15+
// CtxGetter gets redis.Pipeliner from trm.CtxManager by casting trm.Transaction to redis.UniversalClient.
1616
type CtxGetter struct {
17-
ctxManager trm.СtxManager
17+
ctxManager trm.CtxManager
1818
}
1919

2020
// NewCtxGetter returns *CtxGetter to get Cmdable from context.Context.
21-
func NewCtxGetter(c trm.СtxManager) *CtxGetter {
21+
func NewCtxGetter(c trm.CtxManager) *CtxGetter {
2222
return &CtxGetter{ctxManager: c}
2323
}
2424

sql/context.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@ import (
1111
// DefaultCtxGetter is the CtxGetter with settings.DefaultCtxKey.
1212
var DefaultCtxGetter = NewCtxGetter(trmcontext.DefaultManager)
1313

14-
// CtxGetter gets Tr from trm.СtxManager by casting trm.Transaction to Tr.
14+
// CtxGetter gets Tr from trm.CtxManager by casting trm.Transaction to Tr.
1515
type CtxGetter struct {
16-
ctxManager trm.СtxManager
16+
ctxManager trm.CtxManager
1717
}
1818

1919
// NewCtxGetter returns *CtxGetter to get Tr from context.Context.
20-
func NewCtxGetter(c trm.СtxManager) *CtxGetter {
20+
func NewCtxGetter(c trm.CtxManager) *CtxGetter {
2121
return &CtxGetter{ctxManager: c}
2222
}
2323

sqlx/context.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ import (
1212
// DefaultCtxGetter is the CtxGetter with settings.DefaultCtxKey.
1313
var DefaultCtxGetter = NewCtxGetter(trmcontext.DefaultManager)
1414

15-
// CtxGetter gets Tr from trm.СtxManager by casting trm.Transaction to Tr.
15+
// CtxGetter gets Tr from trm.CtxManager by casting trm.Transaction to Tr.
1616
type CtxGetter struct {
17-
ctxManager trm.СtxManager
17+
ctxManager trm.CtxManager
1818
}
1919

2020
// NewCtxGetter returns *CtxGetter to get Tr from context.Context.
21-
func NewCtxGetter(c trm.СtxManager) *CtxGetter {
21+
func NewCtxGetter(c trm.CtxManager) *CtxGetter {
2222
return &CtxGetter{ctxManager: c}
2323
}
2424

trm/context.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ type CtxKey interface{}
1010
// CtxGetter gets Transaction from context.Context.
1111
type CtxGetter func(ctx context.Context) Transaction
1212

13-
// СtxManager sets and gets a Transaction in/from context.Context.
14-
type СtxManager interface {
13+
// CtxManager sets and gets a Transaction in/from context.Context.
14+
type CtxManager interface {
1515
// Default gets Transaction from context.Context by default CtxKey.
1616
Default(ctx context.Context) Transaction
1717
// SetDefault sets.Transaction in context.Context by default CtxKey.
@@ -22,3 +22,8 @@ type СtxManager interface {
2222
// SetByKey sets Transaction in context.Context by.CtxKey.
2323
SetByKey(ctx context.Context, key CtxKey, t Transaction) context.Context
2424
}
25+
26+
// СtxManager is old name with first non-ASCII character.
27+
// Deprecated: Type name contains first non-ASCII character.
28+
// Type is safed in terms of backward compatibility, use above CtxManager instead.
29+
type СtxManager = CtxManager

trm/context/context.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ import (
88
"github.com/avito-tech/go-transaction-manager/trm/settings"
99
)
1010

11-
// DefaultManager is a trm.СtxManager with settings.DefaultCtxKey.
11+
// DefaultManager is a trm.CtxManager with settings.DefaultCtxKey.
1212
var DefaultManager = New(settings.DefaultCtxKey) //nolint:gochecknoglobals
1313

14-
// Manager implements trm.СtxManager.
14+
// Manager implements trm.CtxManager.
1515
type Manager struct {
1616
ctxKey trm.CtxKey
1717
}

0 commit comments

Comments
 (0)