Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var StdExcludeDirRegexps = []*regexp.Regexp{ regexp.MustCompile("^vendor$"), regexp.MustCompile("^third_party$"), regexp.MustCompile("^testdata$"), regexp.MustCompile("^examples$"), regexp.MustCompile("^Godeps$"), regexp.MustCompile("^builtin$"), }
StdExcludeDirRegexps is the standard directory exclusion list from golangci-lint. See https://github.com/golangci/golangci-lint/blob/master/pkg/packages/skip.go.
Functions ¶
func FindAndAddVanityImportForDir ¶
FindAndAddVanityImportForDir scans all files in a folder and based on go.mod files encountered decides wether add a vanity import or not.
Types ¶
type Options ¶
type Options struct { // writes result to file directly WriteResultToFile bool // List files to be changed ListDiffFiles bool // Set of regex for matching files to be skipped SkipFilesRegexes []*regexp.Regexp // Set of regex for matching directories to be skipped SkipDirsRegexes []*regexp.Regexp // Include internal packages IncludeInternal bool // Set of regex for matching files to be included RestrictToFilesRegexes []*regexp.Regexp // Set of regex for matching dirs to be included RestrictToDirsRegexes []*regexp.Regexp }
Options represents the options for adding vanity import.
Click to show internal directories.
Click to hide internal directories.