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: default.go
    path of file: ./repos/kubernetes/staging/src/k8s.io/kubectl/pkg/drain
    
    the code of the file until where you have to start completion: /*
Copyright 2019 The Kubernetes Authors.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BA
    
func RunCordonOrUncordon(drainer *Helper, node *corev1.Node, desired bool) error {
	if drainer.Ctx == nil {
		return fmt.Errorf("RunCordonOrUncordon error: drainer.Ctx can't be nil")
	}
	if drainer.Client == nil {
		return fmt.Errorf("RunCordonOrUncordon error: drainer.Client can't be nil")
	}
	// TODO(justinsb): Ensure we have adequate e2e coverage of this function in library consumers
	c := NewCordonHelper(node)

	if updateRequired := c.UpdateIfRequired(desired); !updateRequired {
		// Already done
		return nil
	}

	err, patchErr := c.PatchOrReplaceWithContext(drainer.Ctx, drainer.Client, false)
	if err != nil {
		if patchErr != nil {
			return fmt.Errorf("cordon error: %s; merge patch error: %w", err.Error(), patchErr)
		}
		return fmt.Errorf("cordon error: %w", err)
	}

	return nil
}