Skip to content

Commit f498366

Browse files
committed
make linter happy
1 parent ccf82df commit f498366

File tree

6 files changed

+13
-13
lines changed

6 files changed

+13
-13
lines changed

internal/pgengine/access_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ func TestLogChainElementExecution(t *testing.T) {
104104
pge := pgengine.NewDB(mockPool, "pgengine_unit_test")
105105
defer mockPool.Close()
106106

107-
t.Run("Check LogChainElementExecution if sql fails", func(t *testing.T) {
107+
t.Run("Check LogChainElementExecution if sql fails", func(*testing.T) {
108108
mockPool.ExpectExec("INSERT INTO .*execution_log").WithArgs(
109109
pgxmock.AnyArg(), pgxmock.AnyArg(), pgxmock.AnyArg(), pgxmock.AnyArg(), pgxmock.AnyArg(), pgxmock.AnyArg(),
110110
pgxmock.AnyArg(), pgxmock.AnyArg(), pgxmock.AnyArg(), pgxmock.AnyArg(), pgxmock.AnyArg()).

internal/pgengine/bootstrap.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ func New(ctx context.Context, cmdOpts config.CmdOptions, logger log.LoggerHooker
9898

9999
config := pge.getPgxConnConfig()
100100
if err = retry.Do(connctx, backoff, func(ctx context.Context) error {
101-
if pge.ConfigDb, err = pgxpool.NewWithConfig(connctx, config); err == nil {
101+
if pge.ConfigDb, err = pgxpool.NewWithConfig(ctx, config); err == nil {
102102
err = pge.ConfigDb.Ping(connctx)
103103
}
104104
if err != nil {
@@ -161,7 +161,7 @@ func (pge *PgEngine) getPgxConnConfig() *pgxpool.Config {
161161
// and another connection for LogHook.send()
162162
connConfig.MaxConns = int32(pge.Resource.CronWorkers) + int32(pge.Resource.IntervalWorkers) + 3
163163
connConfig.ConnConfig.RuntimeParams["application_name"] = "pg_timetable"
164-
connConfig.ConnConfig.OnNotice = func(c *pgconn.PgConn, n *pgconn.Notice) {
164+
connConfig.ConnConfig.OnNotice = func(_ *pgconn.PgConn, n *pgconn.Notice) {
165165
pge.l.WithField("severity", n.Severity).WithField("notice", n.Message).Info("Notice received")
166166
}
167167
connConfig.AfterConnect = func(ctx context.Context, pgconn *pgx.Conn) (err error) {

internal/pgengine/migration.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ var Migrations func() migrator.Option = func() migrator.Option {
5858
return migrator.Migrations(
5959
&migrator.Migration{
6060
Name: "00259 Restart migrations for v4",
61-
Func: func(ctx context.Context, tx pgx.Tx) error {
61+
Func: func(context.Context, pgx.Tx) error {
6262
// "migrations" table will be created automatically
6363
return nil
6464
},

internal/scheduler/chain_test.go

+5-5
Original file line numberDiff line numberDiff line change
@@ -63,14 +63,14 @@ func TestChainWorker(t *testing.T) {
6363
sch := New(pge, log.Init(config.LoggingOpts{LogLevel: "error"}))
6464
chains := make(chan Chain, 16)
6565

66-
t.Run("Check chainWorker if context cancelled", func(t *testing.T) {
66+
t.Run("Check chainWorker if context cancelled", func(*testing.T) {
6767
ctx, cancel := context.WithCancel(context.Background())
6868
cancel()
6969
chains <- Chain{}
7070
sch.chainWorker(ctx, chains)
7171
})
7272

73-
t.Run("Check chainWorker if everything fine", func(t *testing.T) {
73+
t.Run("Check chainWorker if everything fine", func(*testing.T) {
7474
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
7575
defer cancel()
7676
mock.ExpectQuery("SELECT count").WillReturnError(pgx.ErrNoRows)
@@ -82,7 +82,7 @@ func TestChainWorker(t *testing.T) {
8282
sch.chainWorker(ctx, chains)
8383
})
8484

85-
t.Run("Check chainWorker if cannot proceed with chain execution", func(t *testing.T) {
85+
t.Run("Check chainWorker if cannot proceed with chain execution", func(*testing.T) {
8686
ctx, cancel := context.WithTimeout(context.Background(), pgengine.WaitTime+2)
8787
defer cancel()
8888
mock.ExpectQuery("SELECT count").WillReturnError(errors.New("expected"))
@@ -130,13 +130,13 @@ func TestExecuteOnErrorHandler(t *testing.T) {
130130
assert.NoError(t, mock.ExpectationsWereMet())
131131
})
132132

133-
t.Run("check error handler if context cancelled", func(t *testing.T) {
133+
t.Run("check error handler if context cancelled", func(*testing.T) {
134134
ctx, cancel := context.WithCancel(context.Background())
135135
cancel()
136136
sch.executeOnErrorHandler(ctx, c)
137137
})
138138

139-
t.Run("check error handler if error", func(t *testing.T) {
139+
t.Run("check error handler if error", func(*testing.T) {
140140
mock.ExpectExec("FOO").WillReturnError(errors.New("Syntax error near FOO"))
141141
sch.executeOnErrorHandler(context.Background(), c)
142142
})

internal/scheduler/interval_chain_test.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -25,21 +25,21 @@ func TestIntervalChain(t *testing.T) {
2525
sch.intervalChains[ichain.ChainID] = ichain
2626
assert.True(t, sch.isValid(ichain))
2727

28-
t.Run("Check reschedule if self destructive", func(t *testing.T) {
28+
t.Run("Check reschedule if self destructive", func(*testing.T) {
2929
mock.ExpectExec("INSERT INTO timetable\\.log").WillReturnResult(pgxmock.NewResult("EXECUTE", 1))
3030
mock.ExpectExec("DELETE").WillReturnResult(pgxmock.NewResult("EXECUTE", 1))
3131
ichain.SelfDestruct = true
3232
sch.reschedule(context.Background(), ichain)
3333
})
3434

35-
t.Run("Check reschedule if context cancelled", func(t *testing.T) {
35+
t.Run("Check reschedule if context cancelled", func(*testing.T) {
3636
ctx, cancel := context.WithCancel(context.Background())
3737
cancel()
3838
ichain.SelfDestruct = false
3939
sch.reschedule(ctx, ichain)
4040
})
4141

42-
t.Run("Check reschedule if everything fine", func(t *testing.T) {
42+
t.Run("Check reschedule if everything fine", func(*testing.T) {
4343
ichain.Interval = 1
4444
sch.reschedule(context.Background(), ichain)
4545
})

internal/tasks/mail_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ func (d *fakeDialer) DialAndSend(context.Context, ...*gomail.Message) error {
1818

1919
func TestTaskSendMail(t *testing.T) {
2020
assert.NotNil(t, NewDialer("", 0, "", ""), "Default dialer should be created")
21-
NewDialer = func(host string, port int, username, password string) Dialer {
21+
NewDialer = func(string, int, string, string) Dialer {
2222
return &fakeDialer{}
2323
}
2424
assert.NoError(t, SendMail(context.Background(), EmailConn{

0 commit comments

Comments
 (0)