This file is indexed.

/usr/share/gocode/src/github.com/ErikDubbelboer/gspt/gspt_test.go is in golang-github-erikdubbelboer-gspt-dev 0.0~git20161002.0.6ce3e9d-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
package gspt

import (
  "testing"
  "bytes"
  "strings"
  "time"

  "encoding/binary"
  "encoding/hex"

  "crypto/md5"
  "os/exec"
)


func randomMD5() string {
  str    := md5.New()
  random := new(bytes.Buffer)

  binary.Write(random, binary.LittleEndian, time.Now().UTC().UnixNano())

  str.Write(random.Bytes())

  return hex.EncodeToString(str.Sum(nil))
}


func TestSetProcTitle(t *testing.T) {
  if HaveSetProcTitle == HaveNone {
    t.SkipNow()
  }

  title := randomMD5()

  SetProcTitle(title)

  out, err := exec.Command("/bin/ps", "ax").Output()
  if err != nil {
    // No ps available on this platform.
    t.SkipNow()
  } else if !strings.Contains(string(out), title) {
    t.FailNow()
  }
}