func()

in entities/differential.go [42:61]


func (r *DifferentialRevisionReviewers) UnmarshalJSON(b []byte) error {
	var res map[string]string
	err := json.Unmarshal(b, &res)
	if err == nil {
		*r = make(DifferentialRevisionReviewers)
		for k, v := range res {
			(*r)[k] = v
		}
		return nil
	}

	// Try unmarshal to empty slice (such response is provided by Phabricator
	// when there are no reviewers).
	var empty []string
	err = json.Unmarshal(b, &empty)
	if err == nil {
		return nil
	}
	return err
}