mirror of
https://github.com/aclindsa/ofxgo.git
synced 2025-07-01 11:48:38 -04:00
Use named constants instead of strings for enum-like OFX fields
This adds a python script to generate constants.go when `go generate` is called, and updates the structs, tests, and command-line client to all use the new named constants.
This commit is contained in:
@ -1,5 +1,7 @@
|
||||
package ofxgo
|
||||
|
||||
//go:generate ./generate_constants.py
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"github.com/aclindsa/go/src/encoding/xml"
|
||||
@ -261,7 +263,7 @@ type BankAcct struct {
|
||||
BankId String `xml:"BANKID"`
|
||||
BranchId String `xml:"BRANCHID,omitempty"` // Unused in USA
|
||||
AcctId String `xml:"ACCTID"`
|
||||
AcctType String `xml:"ACCTTYPE"` // One of CHECKING, SAVINGS, MONEYMRKT, CREDITLINE, CD
|
||||
AcctType acctType `xml:"ACCTTYPE"` // One of CHECKING, SAVINGS, MONEYMRKT, CREDITLINE, CD
|
||||
AcctKey String `xml:"ACCTKEY,omitempty"` // Unused in USA
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user