From 073387b65b4f2bc03cacd970cdb0cc30404e1d18 Mon Sep 17 00:00:00 2001 From: Aaron Lindsay Date: Thu, 16 Mar 2017 11:14:58 -0400 Subject: [PATCH] Improve comments --- ofx.go | 10 ++++++---- signon.go | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/ofx.go b/ofx.go index c0dffc7..c72f19f 100644 --- a/ofx.go +++ b/ofx.go @@ -66,7 +66,7 @@ func RawRequest(URL string, r io.Reader) (*http.Response, error) { } // Request marshals a Request object into XML, makes an HTTP request against -// it's URL, and then unmarshals the response into a Reaponse object. +// it's URL, and then unmarshals the response into a Response object. // // Before being marshaled, some of the the Request object's values are // overwritten, namely those dictated by the Client's configuration (Version, @@ -107,7 +107,7 @@ type Message interface { type Request struct { URL string - Version string // String for OFX header, defaults to 203 + Version string // OFX version string, overwritten in Client.Request() Signon SignonRequest // Signup []Message // Banking []Message // @@ -384,10 +384,12 @@ func (or *Response) readXMLHeaders(decoder *xml.Decoder) error { return nil } +// Number of bytes of response to read when attempting to figure out whether +// we're using OFX or SGML const guessVersionCheckBytes = 1024 -// Defaults to XML if it can't determine the version based on the first 1024 -// bytes, or if there is any ambiguity +// Defaults to XML if it can't determine the version or if there is any +// ambiguity func guessVersion(r *bufio.Reader) (bool, error) { b, _ := r.Peek(guessVersionCheckBytes) if b == nil { diff --git a/signon.go b/signon.go index 59027bd..536df50 100644 --- a/signon.go +++ b/signon.go @@ -7,7 +7,7 @@ import ( type SignonRequest struct { XMLName xml.Name `xml:"SONRQ"` - DtClient Date `xml:"DTCLIENT"` // Overwritten in Client.Request() + DtClient Date `xml:"DTCLIENT"` // Current time on client, overwritten in Client.Request() UserId String `xml:"USERID"` UserPass String `xml:"USERPASS,omitempty"` UserKey String `xml:"USERKEY,omitempty"`