Skip to content

Commit c280ec7

Browse files
author
Gabriel Sanches
committed
Fix unmarshaling Audience array
1 parent 0da6fc3 commit c280ec7

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

audience.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ func (a Audience) MarshalJSON() ([]byte, error) {
1919
}
2020

2121
// UnmarshalJSON implements an unmarshaling function for "aud" claim.
22-
// TODO(gbrlsnchs): create tests for this method.
2322
func (a *Audience) UnmarshalJSON(b []byte) error {
2423
var (
2524
v interface{}
@@ -34,7 +33,7 @@ func (a *Audience) UnmarshalJSON(b []byte) error {
3433
aud[0] = vv
3534
*a = aud
3635
case []interface{}:
37-
aud := make(Audience, 0, len(vv))
36+
aud := make(Audience, len(vv))
3837
for i := range vv {
3938
aud[i] = vv[i].(string)
4039
}

0 commit comments

Comments
 (0)