Skip to content

Commit 12692b3

Browse files
committed
Fix lints
1 parent 3fd43c3 commit 12692b3

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

common/persistence/sql/sqlplugin/mysql/session/session.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ type (
4747
*sqlx.DB
4848
}
4949

50-
// MySQLVersion specifies which of the distinct mysql versions we support
5150
MySQLVersion int
5251
)
5352

@@ -70,6 +69,7 @@ const (
7069
)
7170

7271
var (
72+
errUnspecifiedMySQLVersion = errors.New("bug: mysql version left unspecified")
7373
errMySQL8VisInterpolateParamsNotSupported = errors.New("interpolateParams is not supported for mysql8 visibility stores")
7474
dsnAttrOverrides = map[string]string{
7575
"parseTime": "true",
@@ -95,7 +95,7 @@ func NewSession(
9595
resolver resolver.ServiceResolver,
9696
) (*Session, error) {
9797
if version == MySQLVersionUnspecified {
98-
return nil, fmt.Errorf("Bug: unspecified MySQL version provided to NewSession")
98+
return nil, errUnspecifiedMySQLVersion
9999
}
100100

101101
db, err := createConnection(version, dbKind, cfg, resolver)

common/persistence/sql/sqlplugin/mysql/session/session_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ func (s *sessionTestSuite) TestBuildDSN() {
173173
}
174174

175175
func (s *sessionTestSuite) Test_MySQL8_Visibility_DoesntSupport_interpolateParams() {
176-
config := config.SQL{
176+
cfg := config.SQL{
177177
User: "test",
178178
Password: "pass",
179179
ConnectProtocol: "tcp",
@@ -182,8 +182,8 @@ func (s *sessionTestSuite) Test_MySQL8_Visibility_DoesntSupport_interpolateParam
182182
ConnectAttributes: map[string]string{"interpolateParams": "ignored"},
183183
}
184184
r := resolver.NewMockServiceResolver(s.controller)
185-
r.EXPECT().Resolve(config.ConnectAddr).Return([]string{config.ConnectAddr})
186-
_, err := buildDSN(MySQLVersion8_0, sqlplugin.DbKindVisibility, &config, r)
185+
r.EXPECT().Resolve(cfg.ConnectAddr).Return([]string{cfg.ConnectAddr})
186+
_, err := buildDSN(MySQLVersion8_0, sqlplugin.DbKindVisibility, &cfg, r)
187187
s.Error(err, "We should return an error when a MySQL8 Visibility database is configured with interpolateParams")
188188
}
189189

0 commit comments

Comments
 (0)