1
0
mirror of https://github.com/aclindsa/ofxgo.git synced 2025-07-01 11:48:38 -04:00

Add validation of banking requests and responses

This commit is contained in:
2017-04-18 19:46:23 -04:00
parent 7f2ca5db0f
commit 1ee7197340
4 changed files with 211 additions and 3 deletions

View File

@ -304,6 +304,15 @@ func (ou UID) RecommendedFormat() (bool, error) {
return true, nil
}
// Valid returns true, nil if the UID is valid. This is less strict than
// RecommendedFormat, and will always return true, nil if it does.
func (ou UID) Valid() (bool, error) {
if len(ou) == 0 || len(ou) > 36 {
return false, errors.New("UID invalid length")
}
return true, nil
}
// Equal returns true if the two UIDs are the same
func (ou UID) Equal(o UID) bool {
return ou == o