Documentation ¶
Overview ¶
Package depcheck defines a test utility for ensuring certain packages don't take on heavy dependencies.
This is forked from https://pkg.go.dev/knative.dev/pkg/depcheck
Index ¶
- func AssertNoDependency(t *testing.T, banned map[string][]string, buildFlags ...string)
- func AssertOnlyDependencies(t *testing.T, allowed map[string][]string, buildFlags ...string)
- func CheckNoDependency(ip string, banned []string, buildFlags ...string) error
- func CheckOnlyDependencies(ip string, allowed map[string]struct{}, buildFlags ...string) error
- func StdlibPackages() []string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AssertNoDependency ¶
AssertNoDependency checks that the given import paths (the keys) do not depend (transitively) on certain banned imports (the values)
func AssertOnlyDependencies ¶
AssertOnlyDependencies checks that the given import paths (the keys) only depend (transitively) on certain allowed imports (the values). Note: while perhaps counterintuitive we allow the value to be a superset of the actual imports to that folks can use a constant that holds blessed import paths.
func CheckNoDependency ¶
CheckNoDependency checks that the given import paths (ip) does not depend (transitively) on certain banned imports.
func CheckOnlyDependencies ¶
CheckOnlyDependencies checks that the given import path only depends (transitively) on certain allowed imports. Note: while perhaps counterintuitive we allow the value to be a superset of the actual imports to that folks can use a constant that holds blessed import paths.
func StdlibPackages ¶
func StdlibPackages() []string
StdlibPackages returns the list of all standard library packages, including some golang.org/x/ dependencies.
Types ¶
This section is empty.