code: func checkMessage(msg *Message) error {
  	if msg == nil {
  		return errors.New("the message must not be nil")
  	} else if msg.RegistrationIDs == nil {
  		return errors.New("the message's RegistrationIDs field must not be nil")
  	} else if len(msg.RegistrationIDs) == 0 {
  		return errors.New("the message must specify at least one registration ID")
  	} else if len(msg.RegistrationIDs) > 1000 {
  		return errors.New("the message may specify at most 1000 registration IDs")
  	} else if msg.TimeToLive < 0 || 2419200 < msg.TimeToLive {
  		return errors.New("the message's TimeToLive field must be an integer " +
  			"between 0 and 2419200 (4 weeks)")
  	}
  	return nil
  }
docs: // checkMessage returns an error if the message is not well-formed.