remove race from closed-over err variable
This commit is contained in:
parent
85593b432e
commit
b84e6f7f95
|
@ -364,7 +364,7 @@ func (c *LoginCommand) interactiveGetTokenByCode(hostname svchost.Hostname, cred
|
|||
}),
|
||||
}
|
||||
go func() {
|
||||
err = server.Serve(listener)
|
||||
err := server.Serve(listener)
|
||||
if err != nil && err != http.ErrServerClosed {
|
||||
diags = diags.Append(tfdiags.Sourceless(
|
||||
tfdiags.Error,
|
||||
|
@ -417,8 +417,7 @@ func (c *LoginCommand) interactiveGetTokenByCode(hostname svchost.Hostname, cred
|
|||
return nil, diags
|
||||
}
|
||||
|
||||
err = server.Close()
|
||||
if err != nil {
|
||||
if err := server.Close(); err != nil {
|
||||
// The server will close soon enough when our process exits anyway,
|
||||
// so we won't fuss about it for right now.
|
||||
log.Printf("[WARN] login: callback server can't shut down: %s", err)
|
||||
|
|
Loading…
Reference in New Issue