Skip to content

Commit a065f79

Browse files
committed
remove unused ctx
1 parent 59382d2 commit a065f79

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

cmd/src/login.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,12 +101,12 @@ func loginCmd(ctx context.Context, p loginParams) error {
101101
fmt.Fprintf(p.out, "⚠️ Warning: Configuring src with a JSON file is deprecated. Please migrate to using the env vars SRC_ENDPOINT, SRC_ACCESS_TOKEN, and SRC_PROXY instead, and then remove %s. See https://github.com/sourcegraph/src-cli#readme for more information.\n", p.cfg.ConfigFilePath)
102102
}
103103

104-
_, flow := selectLoginFlow(ctx, p)
104+
_, flow := selectLoginFlow(p)
105105
return flow(ctx, p)
106106
}
107107

108108
// selectLoginFlow decides what login flow to run based on configured AuthMode.
109-
func selectLoginFlow(_ context.Context, p loginParams) (loginFlowKind, loginFlow) {
109+
func selectLoginFlow(p loginParams) (loginFlowKind, loginFlow) {
110110
endpointArg := cleanEndpoint(p.endpoint)
111111

112112
switch p.cfg.AuthMode() {

cmd/src/login_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ func TestSelectLoginFlow(t *testing.T) {
176176
endpoint: "https://sourcegraph.example.com",
177177
}
178178

179-
if got, _ := selectLoginFlow(context.Background(), params); got != loginFlowOAuth {
179+
if got, _ := selectLoginFlow(params); got != loginFlowOAuth {
180180
t.Fatalf("flow = %v, want %v", got, loginFlowOAuth)
181181
}
182182
})
@@ -187,7 +187,7 @@ func TestSelectLoginFlow(t *testing.T) {
187187
endpoint: "https://sourcegraph.example.com",
188188
}
189189

190-
if got, _ := selectLoginFlow(context.Background(), params); got != loginFlowEndpointConflict {
190+
if got, _ := selectLoginFlow(params); got != loginFlowEndpointConflict {
191191
t.Fatalf("flow = %v, want %v", got, loginFlowEndpointConflict)
192192
}
193193
})
@@ -198,7 +198,7 @@ func TestSelectLoginFlow(t *testing.T) {
198198
endpoint: "https://example.com",
199199
}
200200

201-
if got, _ := selectLoginFlow(context.Background(), params); got != loginFlowValidate {
201+
if got, _ := selectLoginFlow(params); got != loginFlowValidate {
202202
t.Fatalf("flow = %v, want %v", got, loginFlowValidate)
203203
}
204204
})

0 commit comments

Comments
 (0)