depcheck

package
v0.18.0 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 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.

This is forked from https://pkg.go.dev/knative.dev/pkg/depcheck

Index

Constants

This section is empty.

Variables

This section is empty.

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.

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.

Jump to

Keyboard shortcuts

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