File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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
Original file line number Diff line number Diff 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
Original file line number Diff line number Diff line change @@ -15,13 +15,13 @@ import (
1515// DefaultCtxGetter is the CtxGetter with settings.DefaultCtxKey.
1616var 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.
1919type 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
Original file line number Diff line number Diff line change @@ -13,13 +13,13 @@ import (
1313// DefaultCtxGetter is the CtxGetter with settings.DefaultCtxKey.
1414var 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.
1717type 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
Original file line number Diff line number Diff line change @@ -13,13 +13,13 @@ import (
1313// DefaultCtxGetter is the CtxGetter with settings.DefaultCtxKey.
1414var 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.
1717type 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
Original file line number Diff line number Diff line change @@ -12,13 +12,13 @@ import (
1212// DefaultCtxGetter is the CtxGetter with settings.DefaultCtxKey.
1313var 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.
1616type 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
Original file line number Diff line number Diff line change @@ -11,13 +11,13 @@ import (
1111// DefaultCtxGetter is the CtxGetter with settings.DefaultCtxKey.
1212var 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.
1515type 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
Original file line number Diff line number Diff line change @@ -12,13 +12,13 @@ import (
1212// DefaultCtxGetter is the CtxGetter with settings.DefaultCtxKey.
1313var 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.
1616type 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
Original file line number Diff line number Diff line change @@ -10,8 +10,8 @@ type CtxKey interface{}
1010// CtxGetter gets Transaction from context.Context.
1111type 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
Original file line number Diff line number Diff 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.
1212var DefaultManager = New (settings .DefaultCtxKey ) //nolint:gochecknoglobals
1313
14- // Manager implements trm.СtxManager .
14+ // Manager implements trm.CtxManager .
1515type Manager struct {
1616 ctxKey trm.CtxKey
1717}
You can’t perform that action at this time.
0 commit comments