Remove a single-use variable in Login

Should not change behavior.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
This commit is contained in:
Miloslav Trmač 2021-09-11 17:52:44 +02:00
parent 2db91a8d01
commit e0b05e152e
1 changed files with 1 additions and 3 deletions

View File

@ -75,8 +75,7 @@ func Login(ctx context.Context, systemContext *types.SystemContext, opts *LoginO
ref reference.Named
err error
)
l := len(args)
switch l {
switch len(args) {
case 0:
if !opts.AcceptUnspecifiedRegistry {
return errors.New("please provide a registry to login to")
@ -95,7 +94,6 @@ func Login(ctx context.Context, systemContext *types.SystemContext, opts *LoginO
default:
return errors.New("login accepts only one registry to login to")
}
if ref != nil {