Documentation ¶
Index ¶
Constants ¶
View Source
const ( RenderName = 1 << iota RenderImportPath RenderLicense RenderSynopsis RenderHomeSite )
View Source
const RenderAll = RenderName | RenderImportPath | RenderLicense | RenderSynopsis | RenderHomeSite
View Source
const RenderUndefined = 0
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DefaultFormatter ¶
type DefaultFormatter struct {
*ShortFormatter
}
func NewDefaultFormatter ¶
func NewDefaultFormatter(options ...FormatterOption) *DefaultFormatter
func (*DefaultFormatter) Format ¶
func (f *DefaultFormatter) Format(p Package) string
type FormatterOption ¶
type FormatterOption func(f *ShortFormatter)
func NotRenderEmpty ¶
func NotRenderEmpty() FormatterOption
func NotRenderTitle ¶
func NotRenderTitle() FormatterOption
func RenderParts ¶
func RenderParts(flags ...int) FormatterOption
type Package ¶
type Package struct { // 包名称 Name string // 导入路径 ImportPath string // 主页 HomeSite string // 概要信息 Synopsis string // 许可证 License string }
Package 代指一个Go模块
type ShortFormatter ¶
type ShortFormatter struct {
// contains filtered or unexported fields
}
func NewShortFormatter ¶
func NewShortFormatter(options ...FormatterOption) *ShortFormatter
func (*ShortFormatter) Format ¶
func (s *ShortFormatter) Format(p Package) string
Click to show internal directories.
Click to hide internal directories.