This file is indexed.

/usr/share/gocode/src/github.com/coreos/pkg/timeutil/backoff_test.go is in golang-github-coreos-pkg-dev 3-1.

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
52
package timeutil

import (
	"testing"
	"time"
)

func TestExpBackoff(t *testing.T) {
	tests := []struct {
		prev time.Duration
		max  time.Duration
		want time.Duration
	}{
		{
			prev: time.Duration(0),
			max:  time.Minute,
			want: time.Second,
		},
		{
			prev: time.Second,
			max:  time.Minute,
			want: 2 * time.Second,
		},
		{
			prev: 16 * time.Second,
			max:  time.Minute,
			want: 32 * time.Second,
		},
		{
			prev: 32 * time.Second,
			max:  time.Minute,
			want: time.Minute,
		},
		{
			prev: time.Minute,
			max:  time.Minute,
			want: time.Minute,
		},
		{
			prev: 2 * time.Minute,
			max:  time.Minute,
			want: time.Minute,
		},
	}

	for i, tt := range tests {
		got := ExpBackoff(tt.prev, tt.max)
		if tt.want != got {
			t.Errorf("case %d: want=%v got=%v", i, tt.want, got)
		}
	}
}