Files
ana-ledger/ledger/like.go
2023-10-22 22:03:26 -06:00

16 lines
270 B
Go

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)
}