imports

package
v0.0.0-...-171d2f1 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2019 License: BSD-3-Clause Imports: 11 Imported by: 0

Documentation

Overview

Package imports provides an API to check whether code imports packages according to a whitelist/blacklist scheme.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckAllowed

func CheckAllowed(dir string, whitelist, blacklist []string) error

CheckAllowed analyzes all Go files under dir for imports based on a whitelist/blacklist scheme. If CheckAllowed encounters multiple files importing non-allowed imports, the first error is returned to the user.

Types

type Error

type Error struct {
	File    string
	Imports []string
}

Error stores information about a disallowed import in a Go file.

func (Error) Error

func (e Error) Error() string

Jump to

Keyboard shortcuts

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