1
0
mirror of https://github.com/aclindsa/ofxgo.git synced 2024-12-26 06:53:21 -05:00

Response: Use SignonRs.String() instead of a raw string

This commit is contained in:
Aaron Lindsay 2017-03-31 15:30:10 -04:00
parent d07455d797
commit 6618e031a7

View File

@ -295,7 +295,7 @@ func ParseResponse(reader io.Reader) (*Response, error) {
tok, err = nextNonWhitespaceToken(decoder)
if err != nil {
return nil, err
} else if signonStart, ok := tok.(xml.StartElement); ok && signonStart.Name.Local == "SIGNONMSGSRSV1" {
} else if signonStart, ok := tok.(xml.StartElement); ok && signonStart.Name.Local == SignonRs.String() {
if err := decoder.Decode(&or.Signon); err != nil {
return nil, err
}
@ -306,7 +306,7 @@ func ParseResponse(reader io.Reader) (*Response, error) {
tok, err = nextNonWhitespaceToken(decoder)
if err != nil {
return nil, err
} else if signonEnd, ok := tok.(xml.EndElement); !ok || signonEnd.Name.Local != "SIGNONMSGSRSV1" {
} else if signonEnd, ok := tok.(xml.EndElement); !ok || signonEnd.Name.Local != SignonRs.String() {
return nil, errors.New("Missing closing SIGNONMSGSRSV1 xml element")
}
if ok, err := or.Signon.Valid(); !ok {