imports

package
v0.0.0-...-e600875 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2016 License: Apache-2.0 Imports: 16 Imported by: 21

Documentation

Overview

Package imports scans for Go package import paths.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Format

func Format(pkgs []string, format string) ([]byte, error)

Format takes a slice of packages and formats it.

func Parse

func Parse(file string) ([]string, error)

Parse takes a Go file path and parses its import paths.

func Path

func Path(dir string) (string, error)

Path returns the import path of a package directory. It does so via $GOPATH.

func Scan

func Scan(path string, options ...ScanOptions) ([]string, error)

Scan takes a directory and scans it for import dependencies.

func Valid

func Valid(path string) bool

Valid takes an import package path and determines if its valid.

Types

type ScanOptions

type ScanOptions int

ScanOptions represents available scan options.

const (
	// SinglePackage only scans a single package
	SinglePackage ScanOptions = iota

	// SkipTestFiles does not scan files that end in "_test.go".
	SkipTestFiles

	// SkipFilters returns the raw unfiltered list of scanned packages.
	SkipFilters
)

func ParseOptions

func ParseOptions(skipTestFiles, skipFilters bool) []ScanOptions

ParseOptions converts cli flag inputs to ScanOptions.

Directories

Path Synopsis
Package filters provides filters for Go package import paths.
Package filters provides filters for Go package import paths.

Jump to

Keyboard shortcuts

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