Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Version = "v0.2.8 20220305"
Version 版本信息
Functions ¶
func GitChangeFiles ¶ added in v0.2.0
GitChangeFiles 获取当前git项目有变更的文件 支持如下git状态: M auth/md5_sign.go R utils/counter_test.go -> component/counter/counter_test.go A unittest/internal/monitor/bvar.apis_monitor.data ?? internal/gofmt/files.go
Types ¶
type ImportGroupFunc ¶ added in v0.2.0
ImportGroupFunc import 排序逻辑
type Options ¶
type Options struct { Trace bool TabIndent bool TabWidth int // LocalPrefix 当前模块的前缀 LocalPrefix string // Write 是否直接将格式化后的内容写入文件 Write bool // Simplify 是否简化代码 Simplify bool // 待处理的文件列表 Files []string ImportGroupFn ImportGroupFunc // 是否将多段 import 合并为一个 MergeImports bool // SingleLineCopyright 是否将 copyright 的多行注释格式化为单行注释 SingleLineCopyright bool // import 分组的排序规则,可选 // 总共 可分为 3 组,分别是 标准库(简称 s),第三方库(简称 t),模块自身(简称 c) // stc: 默认的排序规则 // sct: Go 源码中的排序规则 ImportGroupRule string }
Options 选项
func NewDefaultOptions ¶ added in v0.2.0
func NewDefaultOptions() *Options
NewDefaultOptions 生成默认的 options
func (*Options) AllGoFiles ¶ added in v0.2.0
AllGoFiles 获取所有的待格式化的 .go 文件
func (*Options) GetImportGroup ¶ added in v0.2.7
GetImportGroup 读取 import 分组的排序
Click to show internal directories.
Click to hide internal directories.