importlint

package module
v0.0.0-...-d8c60dd Latest Latest
Warning

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

Go to latest
Published: May 11, 2018 License: BSD-3-Clause Imports: 12 Imported by: 0

README

go-importlint

circleci.com codecov.io

The linter for Go imported packages.

Documentation

Overview

Package importlint provide linter of package imports.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckDependency

func CheckDependency(pkgs map[string]*ast.Package, conf *Config)

func ParseDir

func ParseDir(fset *token.FileSet, bctx *BuildContext, path string, filter func(os.FileInfo) bool, mode parser.Mode) (map[string]*ast.Package, error)

ParseDir wrapper of buildutil.ParseFile with BuildContext.

Types

type BuildContext

type BuildContext struct {
	// contains filtered or unexported fields
}

func NewBuildContext

func NewBuildContext(root string) BuildContext

func (*BuildContext) Context

func (b *BuildContext) Context() *build.Context

func (*BuildContext) FindAllPackage

func (bc *BuildContext) FindAllPackage(ignores []string, mode FindMode) ([]*build.Package, error)

FindAllPackage returns a list of all packages in all of the GOPATH trees in the given build context. If prefix is non-empty, only packages whose import paths begin with prefix are returned.

type Config

type Config struct {
	Project string              `yaml:"project"`
	Layer   map[string][]string `yaml:"layer"`
}

func ParseConfig

func ParseConfig(path string) (*Config, error)

type FindMode

type FindMode int
const (
	ExcludeVendor FindMode = 1 << iota
)

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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