This file is indexed.

/usr/share/gocode/src/github.com/lunny/nodb/multi_test.go is in golang-github-lunny-nodb-dev 0.0~git20160621.0.fc1ef06-4.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
package nodb

import (
	"sync"
	"testing"
)

func TestMulti(t *testing.T) {
	db := getTestDB()

	key := []byte("test_multi_1")
	v1 := []byte("v1")
	v2 := []byte("v2")

	m, err := db.Multi()
	if err != nil {
		t.Fatal(err)
	}

	wg := sync.WaitGroup{}

	wg.Add(1)

	go func() {
		if err := db.Set(key, v2); err != nil {
			t.Fatal(err)
		}
		wg.Done()
	}()

	if err := m.Set(key, v1); err != nil {
		t.Fatal(err)
	}

	if v, err := m.Get(key); err != nil {
		t.Fatal(err)
	} else if string(v) != string(v1) {
		t.Fatal(string(v))
	}

	m.Close()

	wg.Wait()

	if v, err := db.Get(key); err != nil {
		t.Fatal(err)
	} else if string(v) != string(v2) {
		t.Fatal(string(v))
	}

}