Documentation ¶
Overview ¶
Package pkg contains the core logic of the gotest-ls tool which finds all the go test files. and using ast package, it lists all the tests in the given files.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type TestDetail ¶
type TestDetail struct { Name string `json:"name"` FileName string `json:"fileName"` RelativePath string `json:"relativePath"` AbsolutePath string `json:"absolutePath"` Line int `json:"line"` Pos token.Pos `json:"pos"` }
TestDetail is a struct that contains the details of a single test. It contains the name of the test, the line number, the file name, the relative path and the absolute path. It also contains the token position (token.Pos) of the test in the file.
func List ¶
func List(fileOrDirs []string) ([]TestDetail, error)
List returns all the go test files in the given directories or a given file. It returns an error if the given directories are invalid. It returns an empty slice if no tests are found. The returned slice is sorted by the test name.