func (n *NumericDate) UnmarshalJSON(b []byte) error {
	s := string(b)
	f, err := strconv.ParseFloat(s, 64)
	if err != nil {
		return ErrUnmarshalNumericDate
	}
	*n = NumericDate(f)
	return nil
}
UnmarshalJSON reads a date from its JSON representation.
package jwt
import (
	"strconv"
	"time"
	"gopkg.in/square/go-jose.v2/json"
)
type Claims struct {
	Issuer    string       `json:"iss,omitempty"`
	Subject   string       `json:"sub,omitempty"`
	Audience  Audience     `json:"aud,omitempty"`
	Expiry    *NumericDate `json:"exp,omitempty"`
	NotBefore *NumericDate `json:"nbf,omitempty"`
	IssuedAt  *NumericDate `json:"iat,omitempty"`
	ID        string       `json:"jti,omitempty"`
}
type NumericDate int64
func NewNumericDate(t time.Time) *NumericDate {
	if t.IsZero() {
		return nil
	}
	out := NumericDate(t.Unix())
	return &out
}
func (n NumericDate) MarshalJSON() ([]byte, error) {
	return []byte(strconv.FormatInt(int64(n), 10)), nil
}