This commit is contained in:
bel
2023-10-22 22:03:26 -06:00
parent 61cd82b307
commit 078c425d9e
6 changed files with 108 additions and 0 deletions

15
ledger/like.go Normal file
View 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)
}