mirror of
https://github.com/hanzo-fi/payments.git
synced 2026-10-30 20:31:20 +00:00
* Move models and other shareable code to pkg/domain and add own go.mod * Update all references to use pkg/domain paths * Fix generated file * Ensure pkg/domain tests are run by just tests * Use new models path in connector templates * Copy local pkg/domain in dockerfile * Ensure pkg/domain is subject to go generate
15 lines
302 B
Go
15 lines
302 B
Go
package assets
|
|
|
|
import (
|
|
"regexp"
|
|
)
|
|
|
|
// Pattern mirrors Ledger's canonical asset regex (formancehq/ledger/pkg/assets).
|
|
const Pattern = `[A-Z][A-Z0-9]{0,16}(_[A-Z]{1,16})?(\/\d{1,6})?`
|
|
|
|
var Regexp = regexp.MustCompile("^" + Pattern + "$")
|
|
|
|
func IsValid(v string) bool {
|
|
return Regexp.MatchString(v)
|
|
}
|