depcheck

package
v0.0.0-...-fc0720b Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package depcheck defines a test utility for ensuring certain packages don't take on heavy dependencies.

Index

Constants

This section is empty.

Variables

View Source
var (
	// KnownHeavyDependencies is a list of dependencies that are known to increase the
	// binary's size by a lot.
	KnownHeavyDependencies = []string{
		"k8s.io/apimachinery/pkg/api/apitesting/fuzzer",

		"k8s.io/client-go/kubernetes",

		"contrib.go.opencensus.io/exporter/stackdriver",
	}
)

Functions

func AssertNoDependency

func AssertNoDependency(t *testing.T, banned map[string][]string, buildFlags ...string)

AssertNoDependency checks that the given import paths (the keys) do not depend (transitively) on certain banned imports (the values)

func AssertOnlyDependencies

func AssertOnlyDependencies(t *testing.T, allowed map[string][]string, buildFlags ...string)

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

func CheckNoDependency(ip string, banned []string, buildFlags ...string) error

CheckNoDependency checks that the given import paths (ip) does not depend (transitively) on certain banned imports.

func CheckOnlyDependencies

func CheckOnlyDependencies(ip string, allowed map[string]struct{}, buildFlags ...string) error

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.

Jump to

Keyboard shortcuts

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