Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
// MaxLen Max target width for each line
MaxLen int
// TabLen Width of a tab character
TabLen int
// KeepAnnotations Whether to keep annotations in the final result (for debugging only)
KeepAnnotations bool
// ShortenComments Whether to shorten comments
ShortenComments bool
// ReformatTags Whether to reformat struct tags in addition to shortening long lines
ReformatTags bool
// DotFile Path to write dot-formatted output to (for debugging only)
DotFile string
// ChainSplitDots Whether to split chain methods by putting dots at the ends of lines
ChainSplitDots bool
}
Config stores the configuration options exposed by a Shortener instance.
func NewDefaultConfig ¶
func NewDefaultConfig() *Config
NewDefaultConfig returns a Config with default values.
type Options ¶
type Options func(*Shortener)
Options is the type for configuring options of a Shortener instance.
func WithLogger ¶
WithLogger sets the logger to use it for a Shortener instance.
type Shortener ¶
type Shortener struct {
// contains filtered or unexported fields
}
Shortener shortens a single go file according to a small set of user style preferences.
func NewShortener ¶
NewShortener creates a new shortener instance from the provided config.
Click to show internal directories.
Click to hide internal directories.