ptimports

package
v2.6.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2019 License: Apache-2.0 Imports: 16 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Process

func Process(filename string, src []byte, options *Options) ([]byte, error)

Process formats and adjusts imports for the provided file.

func ProcessFileFromInput

func ProcessFileFromInput(filename string, in io.Reader, list, write bool, options *Options, stdout io.Writer) error

ProcessFileFromInput processes the provided file from the provider reader. If the reader is nil, then the file described by filename is opened and used as the reader.

Types

type Options

type Options struct {
	// if true, converts single-line imports into import blocks
	Refactor bool
	// if true, runs the "gofmt simplify" operation on code
	Simplify bool
	// if true, does not add or remove imports
	FormatOnly bool
	// prefixes to use for goimports operation
	LocalPrefixes []string
}

Jump to

Keyboard shortcuts

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