Skip to content

Commit

Permalink
cmd: moved RegisterStyle to main.go
Browse files Browse the repository at this point in the history
  • Loading branch information
i582 committed Nov 14, 2020
1 parent 2900978 commit e0b85ac
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 15 deletions.
15 changes: 0 additions & 15 deletions cmd/register.go

This file was deleted.

11 changes: 11 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,19 @@ import (
"os"

"github.com/i582/cfmt/internal/parser"
"github.com/i582/cfmt/internal/styles"
)

func RegisterStyle(name string, fn func(string) string) {
styles.Map[name] = func(f func(text string) string) func(text string) string {
return func(text string) string {
t := f(text)
t = fn(t)
return t
}
}
}

func Sprint(a ...interface{}) string {
text := fmt.Sprint(a...)
p := parser.Parser{}
Expand Down

0 comments on commit e0b85ac

Please sign in to comment.