result.go
func NewStatusPolicy(statuses []Status) (*statusPolicy, error) {
	newPol := make(statusPolicy)
	for i, status := range statuses {
		newPol[status] = statusSeverity(i)
	}

	// Ensure all statuses are covered by the new policy.
	defaultPol := NewDefaultStatusPolicy()
	for status := range *defaultPol {
		_, ok := newPol[status]
		if !ok {
			return nil, fmt.Errorf("missing status: %v", status)
		}
	}

	return &newPol, nil
}
func NewStatusPolicy(statuses []Status) (*statusPolicy, error) {
	newPol := make(statusPolicy)
	for i, status := range statuses {
		newPol[status] = statusSeverity(i)
	}

	// Ensure all statuses are covered by the new policy.
	defaultPol := NewDefaultStatusPolicy()
	for status := range *defaultPol {
		_, ok := newPol[status]
		if !ok {
			return nil, fmt.Errorf("missing status: %v", status)
		}
	}

	return &newPol, nil
}
// NewStatusPolicy returns a status policy that assigns relative
// severity in accordance with a user-configurable prioritised slice.
// Check statuses must be listed in ascending severity order.