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: backend.go
    path of file: ./repos/acra/keystore/v2/keystore/filesystem/backend/api/tests
    
    the code of the file until where you have to start completion: /*
 * Copyright 2020, Cossack Labs Limited
 *
 * 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" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the s
    
func testLockingShared(t *testing.T, newBackend NewBackend) {
	b := newBackend(t)

	err := b.RLock()
	if err != nil {
		t.Fatalf("A: failed to grab shared lock: %v", err)
	}

	// We can also grab an exclusive lock (in a separate goroutine),
	// it will wait until all existing shared locks are released.
	done := make(chan struct{})
	go func() {
		defer close(done)
		err := b.Lock()
		if err != nil {
			t.Fatalf("B: failed to grab exclusive lock: %v", err)
		}
		defer func() {
			err := b.Unlock()
			if err != nil {
				t.Fatalf("B: failed to release exclusive lock: %v", err)
			}
		}()

		err = b.Put("a file", []byte("tora-tora-tora!"))
		if err != nil {
			t.Fatalf("B: Put() failed: %v", err)
		}
	}()

	// The file does not exist yet, the goroutine is blocked.
	_, err = b.Get("a file")
	if err != api.ErrNotExist {
		t.Errorf("A: Get() seems to succeed: %v", err)
	}

	// We need to release the lock, then wait for the goroutine to complete,
	// and only then the file should be visible to us.
	err = b.RUnlock()
	if err != nil {
		t.Fatalf("A: failed to release shared lock: %v", err)
	}

	<-done

	data, err := b.Get("a file")
	if err != nil {
		t.Errorf("A: Get() failed (after Unlock x2): %v", err)
	}
	if string(data) != "tora-tora-tora!" {
		t.Errorf("A: Get() read incorrect content: %v", string(data))
	}
}