code: func SubscriptionFromJSON(b []byte) (*Subscription, error) {
  	var sub struct {
  		Endpoint string
  		Keys     struct {
  			P256dh string
  			Auth   string
  		}
  	}
  	if err := json.Unmarshal(b, &sub); err != nil {
  		return nil, err
  	}
  
  	b64 := base64.URLEncoding.WithPadding(base64.NoPadding)
  
  	// Chrome < 52 incorrectly adds padding when Base64 encoding the values, so
  	// we need to strip that out
  	key, err := b64.DecodeString(strings.TrimRight(sub.Keys.P256dh, "="))
  	if err != nil {
  		return nil, err
  	}
  
  	auth, err := b64.DecodeString(strings.TrimRight(sub.Keys.Auth, "="))
  	if err != nil {
  		return nil, err
  	}
  
  	return &Subscription{sub.Endpoint, key, auth}, nil
  }
docs: // SubscriptionFromJSON is a convenience function that takes a JSON encoded
  // PushSubscription object acquired from the browser and returns a pointer to a
  // Subscription