From 8f60c24ff97c447ab9c24e8e6b6dcff2fc79dbfa Mon Sep 17 00:00:00 2001 From: Oleg Kovalov Date: Fri, 28 Jun 2024 11:51:54 +0200 Subject: [PATCH] Tidy newlines and return param (#17) --- otp.go | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/otp.go b/otp.go index ff634fa..03632b2 100644 --- a/otp.go +++ b/otp.go @@ -129,15 +129,12 @@ func (k *Key) Period() uint64 { // Digits returns the digits value. func (k *Key) Digits() uint { - var u uint - if digits := k.values.Get("digits"); digits != "" { if val, err := strconv.ParseUint(digits, 10, 32); err == nil { - u = uint(val) + return uint(val) } } - - return u + return 0 } // Counter returns the counter value. @@ -147,7 +144,6 @@ func (k *Key) Counter() uint64 { return val } } - return 0 } @@ -163,7 +159,6 @@ func (k *Key) Algorithm() Algorithm { return AlgorithmSHA512 } } - return AlgorithmUnknown }