1
0
mirror of https://github.com/aclindsa/ofxgo.git synced 2025-07-01 19:58:37 -04:00

Make optional struct fields pointers

This allows encoding/xml to properly comparison against nil to see if
they should be marshalled if the 'xml' tag contains ",omitempty" and for
users to test against nil to see if a field was present in the parsed
OFX.

This commit also fixes up cmd/ofx to use the new pointers.
This commit is contained in:
2017-03-29 05:31:01 -04:00
parent 119c01f99b
commit 1d8ba5c19a
11 changed files with 130 additions and 150 deletions

View File

@ -6,7 +6,6 @@ import (
"github.com/aclindsa/ofxgo"
"io"
"os"
"time"
)
var invDownloadCommand = Command{
@ -52,11 +51,8 @@ func invDownload() {
BrokerId: ofxgo.String(brokerId),
AcctId: ofxgo.String(acctId),
},
DtStart: ofxgo.Date(time.Now().AddDate(-1, 0, 0)), // a year ago
DtEnd: ofxgo.Date(time.Now().AddDate(0, 0, -1)), // Some FIs (*cough* Fidelity) return errors if DTEND is the current day
Include: true,
IncludeOO: true,
PosDtAsOf: ofxgo.Date(time.Now()),
IncludePos: true,
IncludeBalance: true,
Include401K: true,