Skip to content

Commit

Permalink
Fix unmarshaling Audience array
Browse files Browse the repository at this point in the history
  • Loading branch information
Gabriel Sanches committed Mar 6, 2019
1 parent 0da6fc3 commit c280ec7
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions audience.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ func (a Audience) MarshalJSON() ([]byte, error) {
}

// UnmarshalJSON implements an unmarshaling function for "aud" claim.
// TODO(gbrlsnchs): create tests for this method.
func (a *Audience) UnmarshalJSON(b []byte) error {
var (
v interface{}
Expand All @@ -34,7 +33,7 @@ func (a *Audience) UnmarshalJSON(b []byte) error {
aud[0] = vv
*a = aud
case []interface{}:
aud := make(Audience, 0, len(vv))
aud := make(Audience, len(vv))
for i := range vv {
aud[i] = vv[i].(string)
}
Expand Down

0 comments on commit c280ec7

Please sign in to comment.