Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
MaxLen int // Max target width for each line
TabLen int // Width of a tab character
KeepAnnotations bool // Whether to keep annotations in the final result (for debugging only)
ShortenComments bool // Whether to shorten comments
ReformatTags bool // Whether to reformat struct tags in addition to shortening long lines
DotFile string // Path to write dot-formatted output to (for debugging only)
ChainSplitDots bool // Whether to split chain methods by putting dots at the ends of lines
}
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.