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: mock_plugin_api_test.go
    path of file: ./repos/mattermost/server/public/pluginapi/cluster
    
    the code of the file until where you have to start completion: package cluster

import (
	"bytes"
	"sort"
	"strings"
	"sync"
	"testing"

	"github.com/mattermost/mattermost/server/public/model"
)

type mockPluginAPI struct {
	t *testing.T

	lock              sync.Mutex
	keyValues         map[string][]byte
	failing           bool
	failingWithPrefix string
}

func newMockPluginAPI(t *testing.T) *mockPluginAPI {
	return &mockPluginAPI{
		t:         t,
		
    
func (pluginAPI *mockPluginAPI) KVDelete(key string) *model.AppError {
	pluginAPI.lock.Lock()
	defer pluginAPI.lock.Unlock()

	if pluginAPI.failing {
		return &model.AppError{Message: "fake error"}
	}

	if pluginAPI.failingWithPrefix != "" && strings.HasPrefix(key, pluginAPI.failingWithPrefix) {
		return &model.AppError{Message: "fake error for prefix " + pluginAPI.failingWithPrefix}
	}

	delete(pluginAPI.keyValues, key)

	return nil
}