code: func updateStatus(msg *Message, resp *Response, allResults map[string]Result) int {
  	unsentRegIDs := make([]string, 0, resp.Failure)
  	for i := 0; i < len(resp.Results); i++ {
  		regID := msg.RegistrationIDs[i]
  		allResults[regID] = resp.Results[i]
  		if resp.Results[i].Error == "Unavailable" {
  			unsentRegIDs = append(unsentRegIDs, regID)
  		}
  	}
  	msg.RegistrationIDs = unsentRegIDs
  	return len(unsentRegIDs)
  }
docs: // updateStatus updates the status of the messages sent to devices and
  // returns the number of recoverable errors that could be retried.