@@ -171,33 +171,33 @@ func TestMerge(t *testing.T) {
171171
172172 tests := []struct {
173173 name string
174- claims interface {}
175- other interface {}
176- expected map [string ]interface {}
174+ claims any
175+ other any
176+ expected map [string ]any
177177 }{
178178 {
179179 name : "merge with empty object" ,
180- claims : map [string ]interface {} {"foo" : "bar" },
181- other : map [string ]interface {} {},
182- expected : map [string ]interface {} {"foo" : "bar" },
180+ claims : map [string ]any {"foo" : "bar" },
181+ other : map [string ]any {},
182+ expected : map [string ]any {"foo" : "bar" },
183183 },
184184 {
185185 name : "merge two maps" ,
186- claims : map [string ]interface {} {"foo" : "bar" },
187- other : map [string ]interface {} {"baz" : "qux" },
188- expected : map [string ]interface {} {"foo" : "bar" , "baz" : "qux" },
186+ claims : map [string ]any {"foo" : "bar" },
187+ other : map [string ]any {"baz" : "qux" },
188+ expected : map [string ]any {"foo" : "bar" , "baz" : "qux" },
189189 },
190190 {
191191 name : "merge with Claims struct" ,
192- claims : map [string ]interface {} {
192+ claims : map [string ]any {
193193 "custom" : "value" ,
194194 },
195195 other : Claims {
196196 Issuer : "test-issuer" ,
197197 IssuedAt : now ,
198198 Expiry : expiry ,
199199 },
200- expected : map [string ]interface {} {
200+ expected : map [string ]any {
201201 "custom" : "value" ,
202202 "iss" : "test-issuer" ,
203203 "iat" : float64 (now ), // JSON numbers are decoded as float64
@@ -206,9 +206,9 @@ func TestMerge(t *testing.T) {
206206 },
207207 {
208208 name : "merge with nil" ,
209- claims : map [string ]interface {} {"foo" : "bar" },
209+ claims : map [string ]any {"foo" : "bar" },
210210 other : nil ,
211- expected : map [string ]interface {} {"foo" : "bar" },
211+ expected : map [string ]any {"foo" : "bar" },
212212 },
213213 }
214214
@@ -219,7 +219,7 @@ func TestMerge(t *testing.T) {
219219 t .Fatalf ("Failed to merge: %v" , err )
220220 }
221221
222- var got map [string ]interface {}
222+ var got map [string ]any
223223 if err := json .Unmarshal (result , & got ); err != nil {
224224 t .Fatalf ("Failed to unmarshal result: %v" , err )
225225 }
@@ -237,33 +237,33 @@ func TestMergeAndSign(t *testing.T) {
237237
238238 tests := []struct {
239239 name string
240- claims interface {}
241- other interface {}
242- expected map [string ]interface {}
240+ claims any
241+ other any
242+ expected map [string ]any
243243 }{
244244 {
245245 name : "merge and sign with empty object" ,
246- claims : map [string ]interface {} {"foo" : "bar" },
247- other : map [string ]interface {} {},
248- expected : map [string ]interface {} {"foo" : "bar" },
246+ claims : map [string ]any {"foo" : "bar" },
247+ other : map [string ]any {},
248+ expected : map [string ]any {"foo" : "bar" },
249249 },
250250 {
251251 name : "merge and sign two maps" ,
252- claims : map [string ]interface {} {"foo" : "bar" },
253- other : map [string ]interface {} {"baz" : "qux" },
254- expected : map [string ]interface {} {"foo" : "bar" , "baz" : "qux" },
252+ claims : map [string ]any {"foo" : "bar" },
253+ other : map [string ]any {"baz" : "qux" },
254+ expected : map [string ]any {"foo" : "bar" , "baz" : "qux" },
255255 },
256256 {
257257 name : "merge and sign with Claims struct" ,
258- claims : map [string ]interface {} {
258+ claims : map [string ]any {
259259 "custom" : "value" ,
260260 },
261261 other : Claims {
262262 Issuer : "test-issuer" ,
263263 IssuedAt : now ,
264264 Expiry : expiry ,
265265 },
266- expected : map [string ]interface {} {
266+ expected : map [string ]any {
267267 "custom" : "value" ,
268268 "iss" : "test-issuer" ,
269269 "iat" : fmt .Sprintf ("%d" , now ),
@@ -287,7 +287,7 @@ func TestMergeAndSign(t *testing.T) {
287287
288288 t .Logf ("Generated token: %s" , string (token ))
289289
290- var verifiedClaims map [string ]interface {}
290+ var verifiedClaims map [string ]any
291291 verifiedToken , err := Verify (HS256 , key , token )
292292 if err != nil {
293293 t .Fatalf ("Failed to verify token: %v" , err )
0 commit comments