Documentation
¶
Index ¶
- func BruteForceIndentation(ctx context.Context, startIndentation string, cfg Configuration, ...) (io.Reader, error)
- func BuildTabWriter(writer io.Writer) *tabwriter.Writer
- func Format(ctx context.Context, provider Provider, cfg ConfigurationProvider, ...) (io.Reader, error)
- func FormatSimple(ctx context.Context, provider Provider, filename string, useTabs bool, ...) (io.Reader, error)
- func FormatSimpleBytes(ctx context.Context, provider Provider, filename string, useTabs bool, ...) ([]byte, error)
- func HasShebang(bs []byte) bool
- func Shebang(bs []byte) string
- type Configuration
- type ConfigurationProvider
- type LazyFormatProvider
- type Provider
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BruteForceIndentation ¶ added in v2.8.0
func FormatSimple ¶ added in v2.9.0
func FormatSimpleBytes ¶ added in v2.9.0
func HasShebang ¶ added in v2.8.0
HasShebang reports whether bs begins with a valid shell shebang. It supports variations with /usr and env.
Types ¶
type Configuration ¶
func NewBasicConfigurationProvider ¶
func NewBasicConfigurationProvider(tabs bool, indentSize int) Configuration
type ConfigurationProvider ¶
type ConfigurationProvider interface {
GetConfigurationForFileType(ctx context.Context, filename string) (Configuration, error)
}
func NewDefaultConfigurationProvider ¶ added in v2.7.2
func NewDefaultConfigurationProvider() ConfigurationProvider
type LazyFormatProvider ¶ added in v2.9.0
type LazyFormatProvider struct {
// contains filtered or unexported fields
}
func NewLazyFormatProvider ¶ added in v2.9.0
func NewLazyFormatProvider(providerFunc func() Provider) *LazyFormatProvider
Click to show internal directories.
Click to hide internal directories.