Documentation ¶
Overview ¶
Package depcheck defines a test utility for ensuring certain packages don't take on heavy dependencies.
Index ¶
- Variables
- 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
Constants ¶
This section is empty.
Variables ¶
var KnownHeavyDependencies = []string{
"k8s.io/apimachinery/pkg/api/apitesting/fuzzer",
"k8s.io/client-go/kubernetes",
"contrib.go.opencensus.io/exporter/stackdriver",
}
KnownHeavyDependencies is a list of dependencies that are known to increase the binary's size by a lot.
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.
Types ¶
This section is empty.