feat: init Formatter

main
sudo pacman -Syu 2022-11-25 00:14:47 +07:00
parent 338e835b9c
commit 164bd6b6e8
No known key found for this signature in database
GPG Key ID: D6CB5C6C567C47B0
2 changed files with 43 additions and 0 deletions

View File

@ -0,0 +1,22 @@
package imports
type Formatter struct {
isList bool
isWrite bool
isDiff bool
}
func NewFormmater(opts ...FormatterOptionFn) *Formatter {
f := &Formatter{}
for _, opt := range opts {
opt(f)
}
return f
}
// Accept a list of files or directories aka fsNames
func (f *Formatter) Format(fsNames ...string) error {
return nil
}

View File

@ -0,0 +1,21 @@
package imports
type FormatterOptionFn func(*Formatter)
func FormatterWithList() FormatterOptionFn {
return func(f *Formatter) {
f.isList = true
}
}
func FormatterWithWrite() FormatterOptionFn {
return func(f *Formatter) {
f.isWrite = true
}
}
func FormatterWithDiff() FormatterOptionFn {
return func(f *Formatter) {
f.isDiff = true
}
}