You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: cancel_reason.go
    path of file: ./repos/temporal/service/history/workflow/update
    
    the code of the file until where you have to start completion: // The MIT License
//
// Copyright (c) 2020 Temporal Technologies Inc.  All rights reserved.
//
// Copyright (c) 2020 Uber Technologies, Inc.
//

    
func (r CancelReason) RejectionFailure() *failurepb.Failure {
	switch r {
	case CancelReasonWorkflowCompleted:
		return completedWorkflowFailure
	case CancelReasonWorkflowTerminated:
		return terminatedWorkflowFailure
	default:
		panic("unknown cancel reason")
	}
}