@@ -63,17 +63,15 @@ func (o *OATH) calculate(name string) (string, error) {
6363 return "" , err
6464 }
6565
66- for _ , tag := range res . tags {
66+ for _ , tv := range res {
6767
68- value := res .values [tag ][0 ]
69-
70- switch tag {
68+ switch tv .tag {
7169
7270 case 0x76 :
73- return otp (value ), nil
71+ return otp (tv . value ), nil
7472
7573 default :
76- return "" , fmt .Errorf (errUnknownTag , tag )
74+ return "" , fmt .Errorf (errUnknownTag , tv . tag )
7775 }
7876
7977 }
@@ -103,27 +101,21 @@ func (o *OATH) calculateAll() (map[string]string, error) {
103101 return nil , err
104102 }
105103
106- for _ , tag := range res .tags {
107-
108- values := res .values [tag ]
109-
110- for _ , value := range values {
104+ for _ , tv := range res {
111105
112- switch tag {
106+ switch tv . tag {
113107
114- case 0x71 :
115- names = append (names , string (value ))
108+ case 0x71 :
109+ names = append (names , string (tv . value ))
116110
117- case 0x7c :
118- codes = append (codes , touchRequired )
111+ case 0x7c :
112+ codes = append (codes , touchRequired )
119113
120- case 0x76 :
121- codes = append (codes , otp (value ))
122-
123- default :
124- return nil , fmt .Errorf (errUnknownTag , tag )
125- }
114+ case 0x76 :
115+ codes = append (codes , otp (tv .value ))
126116
117+ default :
118+ return nil , fmt .Errorf (errUnknownTag , tv .tag )
127119 }
128120
129121 }
0 commit comments