ptimports

package
v2.33.0 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2023 License: Apache-2.0 Imports: 15 Imported by: 3

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