walktest

package
v0.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 18, 2026 License: Apache-2.0 Imports: 10 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package walktest reads the module's tree for the roofs' walk tests: the directories, sources, and packages beneath a roof, and the module's package graph as go list reports it. Each roof's tests hold its own rules.

Index

Constants

View Source
const Module = "github.com/fancl20/cion"

Module is the module's import path.

Variables

This section is empty.

Functions

func ChildDirs

func ChildDirs(t *testing.T, dir string) []string

ChildDirs lists a directory's subdirectories, testdata aside. A directory that does not exist has none.

func Dir

func Dir(t *testing.T, rel string) string

Dir returns the directory at a slash-separated path below the module's root, such as "pkg/core".

func Graph

func Graph(t *testing.T) map[string]*Package

Graph reads the module's package graph: every package with its imports.

func HasPackage

func HasPackage(dir string) bool

HasPackage reports whether the directory holds Go source.

func ImportPath

func ImportPath(t *testing.T, dir string) string

ImportPath returns a directory's import path.

func PackagesUnder

func PackagesUnder(t *testing.T, dir string) []string

PackagesUnder lists the import paths of the packages beneath a directory, the directory itself aside.

func Root

func Root(t *testing.T) string

Root returns the module's root directory, two levels above this package.

func Sources

func Sources(t *testing.T, dir string) []string

Sources lists the production Go files directly in a directory, its tests aside.

Types

type Package

type Package struct {
	ImportPath   string
	Imports      []string
	TestImports  []string
	XTestImports []string
}

Package is one package of the module's graph: its import path, its production imports, and its tests' imports.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL