This file is indexed.

/usr/share/gocode/src/github.com/smartystreets/goconvey/reporting/story_report.go is in golang-github-smartystreets-goconvey-dev 1.5.0-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
package reporting

import (
	"strings"

	"github.com/smartystreets/goconvey/gotest"
)

type StoryReport struct {
	Test gotest.T
	Name string
	File string
	Line int
}

func NewStoryReport(test gotest.T) *StoryReport {
	file, line, name := gotest.ResolveExternalCaller()
	name = removePackagePath(name)
	self := &StoryReport{}
	self.Test = test
	self.Name = name
	self.File = file
	self.Line = line
	return self
}

// name comes in looking like "github.com/smartystreets/goconvey/examples.TestName".
// We only want the stuff after the last '.', which is the name of the test function.
func removePackagePath(name string) string {
	parts := strings.Split(name, ".")
	if len(parts) == 1 {
		return name
	}
	return parts[len(parts)-1]
}