consistentimports

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Analyzer = &analysis.Analyzer{
	Name:      "consistentimports",
	Doc:       "detect inconsistent import aliases, reports import paths and aliases count",
	Run:       run,
	Flags:     flag.FlagSet{},
	Requires:  []*analysis.Analyzer{inspect.Analyzer},
	FactTypes: []analysis.Fact{new(pathAliasCountsFact)},
}

Analyzer for consistentimports. Inspired by analysis facts example: https://cs.opensource.google/go/x/tools/+/refs/tags/v0.9.3:go/analysis/passes/pkgfact/pkgfact.go

Functions

This section is empty.

Types

type PrefixPkgModuleChecker added in v0.3.0

type PrefixPkgModuleChecker struct {
	NumSegments uint
}

PrefixPkgModuleChecker decides that packages are in same module by looking how many prefix segments in path they match

func (PrefixPkgModuleChecker) IsSameModule added in v0.3.0

func (s PrefixPkgModuleChecker) IsSameModule(packagePathA, packagePathB string) bool

Directories

Path Synopsis
internal
a
b

Jump to

Keyboard shortcuts

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