Skip to content

Commit

Permalink
fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
akerl committed Jan 5, 2023
1 parent 222a791 commit 5e8d38e
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions ykoath.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,12 @@ func NewFromSerialList(serialList []string) (*OATH, error) {

for _, match := range serialList {
if serial == match {
return &yubikey, nil
return yubikey, nil
}
}
}

return nil, fmt.Errorf(errFailedToListSuitableReader, len(readers))
return nil, fmt.Errorf(errFailedToListSuitableReader, len(yubikeys))
}

// NewSet returns a slice of all Yubikeys on the system
Expand All @@ -102,13 +102,19 @@ func NewSet() ([]*OATH, error) {
continue
}

card, err := context.Connect(reader, scard.ShareShared, scard.ProtocolAny)

if err != nil {
return nil, errors.Wrapf(err, errFailedToConnect)
}

o := OATH{
card: card,
Clock: time.Now,
context: context,
}

yubikeys := append(yubikeys, &o)
yubikeys = append(yubikeys, &o)
}

return yubikeys, nil
Expand Down

0 comments on commit 5e8d38e

Please sign in to comment.