Skip to content

Commit

Permalink
Fix linter complaints
Browse files Browse the repository at this point in the history
  • Loading branch information
tdeebswihart committed Feb 20, 2024
1 parent 03a489a commit 72fa4c6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion common/persistence/sql/sqlplugin/mysql/session/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ const (

var (
errMySQL8VisInterpolateParamsNotSupported = errors.New("interpolateParams is not supported for mysql8 visibility stores")
errUnspecifiedMySQLVersion = errors.New("bug: mysql version not specified")
dsnAttrOverrides = map[string]string{
"parseTime": "true",
"clientFoundRows": "true",
Expand All @@ -95,7 +96,7 @@ func NewSession(
resolver resolver.ServiceResolver,
) (*Session, error) {
if version == MySQLVersionUnspecified {
return nil, fmt.Errorf("Bug: unspecified MySQL version provided to NewSession")
return nil, errUnspecifiedMySQLVersion
}

db, err := createConnection(version, dbKind, cfg, resolver)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ func (s *sessionTestSuite) TestBuildDSN() {
}

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

Expand Down

0 comments on commit 72fa4c6

Please sign in to comment.