Skip to content

Commit 7d9bfc0

Browse files
committed
fix(cli): correct misspellings and redundant conversion flagged by CI lint
The golangci-lint misspell and unconvert checks flagged the #1325 test additions (British "cancelled" spellings, error() conversion of context.Canceled). No behavior change. Refs #1325
1 parent da1eb27 commit 7d9bfc0

2 files changed

Lines changed: 9 additions & 9 deletions

File tree

‎cmd/multi_service_engine_versions.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ func queryMajorEngineVersionsWithClient(ctx context.Context, rdsClient RDSMajorV
222222
return nil, err
223223
}
224224
if err := fetchMajorEngineVersionsForEngine(ctx, rdsClient, engine, versionInfo); err != nil {
225-
// Cancelled caller context is terminal (issue #1325); check ctx.Err(),
225+
// Canceled caller context is terminal (issue #1325); check ctx.Err(),
226226
// not the wrapped API error, so SDK-internal timeouts stay warnings.
227227
if ctxErr := ctx.Err(); ctxErr != nil {
228228
return nil, ctxErr

‎cmd/multi_service_engine_versions_paginate_test.go‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ func TestFetchMajorEngineVersionsForEngine_PaginationCapError(t *testing.T) {
153153
}
154154

155155
// cancelOnFirstQueryRDSMock cancels the context from inside the first API call
156-
// and returns the SDK-shaped error a cancelled request produces, so the fan-out
156+
// and returns the SDK-shaped error a canceled request produces, so the fan-out
157157
// loop sees both a real ctx cancellation and a wrapped context error.
158158
type cancelOnFirstQueryRDSMock struct {
159159
cancel context.CancelFunc
@@ -168,15 +168,15 @@ func (m *cancelOnFirstQueryRDSMock) DescribeDBMajorEngineVersions(
168168
) (*awsrds.DescribeDBMajorEngineVersionsOutput, error) {
169169
m.enginesQueried = append(m.enginesQueried, aws.ToString(params.Engine))
170170
m.cancel()
171-
err := error(context.Canceled)
171+
err := context.Canceled
172172
if m.wrap != nil {
173173
err = m.wrap(err)
174174
}
175175
return nil, err
176176
}
177177

178178
// TestQueryMajorEngineVersionsWithClient_CtxCancelIsTerminal asserts that a
179-
// cancelled context stops the per-engine fan-out instead of being downgraded to
179+
// canceled context stops the per-engine fan-out instead of being downgraded to
180180
// a warning: the loop must return the error and must not keep querying the
181181
// remaining engines (issue #1325).
182182
func TestQueryMajorEngineVersionsWithClient_CtxCancelIsTerminal(t *testing.T) {
@@ -205,7 +205,7 @@ func TestQueryMajorEngineVersionsWithClient_CtxCancelIsTerminal(t *testing.T) {
205205
result, err := queryMajorEngineVersionsWithClient(ctx, mock)
206206

207207
require.ErrorIs(t, err, context.Canceled,
208-
"a cancelled context must not be reported as a successful query")
208+
"a canceled context must not be reported as a successful query")
209209
assert.Nil(t, result,
210210
"partial version info must not be handed back as if it were complete")
211211
assert.Equal(t, []string{"mysql"}, mock.enginesQueried,
@@ -229,10 +229,10 @@ func TestQueryMajorEngineVersionsWithClient_CtxDeadlineIsTerminal(t *testing.T)
229229
"an expired deadline must not issue API calls")
230230
}
231231

232-
// TestQueryMajorEngineVersionsWithClient_CtxAlreadyCancelled asserts that a
233-
// context cancelled before the call fails fast without spending a single API
232+
// TestQueryMajorEngineVersionsWithClient_CtxAlreadyCanceled asserts that a
233+
// context canceled before the call fails fast without spending a single API
234234
// call (issue #1325).
235-
func TestQueryMajorEngineVersionsWithClient_CtxAlreadyCancelled(t *testing.T) {
235+
func TestQueryMajorEngineVersionsWithClient_CtxAlreadyCanceled(t *testing.T) {
236236
ctx, cancel := context.WithCancel(context.Background())
237237
cancel()
238238

@@ -242,5 +242,5 @@ func TestQueryMajorEngineVersionsWithClient_CtxAlreadyCancelled(t *testing.T) {
242242

243243
require.ErrorIs(t, err, context.Canceled)
244244
assert.Empty(t, mock.enginesQueried,
245-
"an already-cancelled context must not issue API calls")
245+
"an already-canceled context must not issue API calls")
246246
}

0 commit comments

Comments
 (0)