someday
This commit is contained in:
15
ledger/like.go
Normal file
15
ledger/like.go
Normal file
@@ -0,0 +1,15 @@
|
||||
package ledger
|
||||
|
||||
import "regexp"
|
||||
|
||||
type Like func(Delta) bool
|
||||
|
||||
func LikeAcc(pattern string) Like {
|
||||
return func(d Delta) bool {
|
||||
return like(pattern, d.Account)
|
||||
}
|
||||
}
|
||||
|
||||
func like(pattern string, other string) bool {
|
||||
return regexp.MustCompile(pattern).MatchString(other)
|
||||
}
|
||||
Reference in New Issue
Block a user