mirror of
https://github.com/aclindsa/ofxgo.git
synced 2024-11-22 03:30:04 -05:00
go vet
and golint
This commit is contained in:
parent
1ee7197340
commit
a3e42fc903
@ -274,6 +274,7 @@ type BankAcct struct {
|
|||||||
AcctKey String `xml:"ACCTKEY,omitempty"` // Unused in USA
|
AcctKey String `xml:"ACCTKEY,omitempty"` // Unused in USA
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Valid returns whether the BankAcct is valid according to the OFX spec
|
||||||
func (b BankAcct) Valid() (bool, error) {
|
func (b BankAcct) Valid() (bool, error) {
|
||||||
if len(b.BankID) == 0 {
|
if len(b.BankID) == 0 {
|
||||||
return false, errors.New("BankAcct.BankID empty")
|
return false, errors.New("BankAcct.BankID empty")
|
||||||
@ -294,6 +295,7 @@ type CCAcct struct {
|
|||||||
AcctKey String `xml:"ACCTKEY,omitempty"` // Unused in USA
|
AcctKey String `xml:"ACCTKEY,omitempty"` // Unused in USA
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Valid returns whether the CCAcct is valid according to the OFX spec
|
||||||
func (c CCAcct) Valid() (bool, error) {
|
func (c CCAcct) Valid() (bool, error) {
|
||||||
if len(c.AcctID) == 0 {
|
if len(c.AcctID) == 0 {
|
||||||
return false, errors.New("CCAcct.AcctID empty")
|
return false, errors.New("CCAcct.AcctID empty")
|
||||||
|
4
types.go
4
types.go
@ -351,7 +351,7 @@ func (c *CurrSymbol) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error
|
|||||||
|
|
||||||
unit, err := currency.ParseISO(value)
|
unit, err := currency.ParseISO(value)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
errors.New("Error parsing CurrSymbol:" + err.Error())
|
return errors.New("Error parsing CurrSymbol:" + err.Error())
|
||||||
}
|
}
|
||||||
c.Unit = unit
|
c.Unit = unit
|
||||||
return nil
|
return nil
|
||||||
@ -375,6 +375,8 @@ func (c CurrSymbol) Valid() (bool, error) {
|
|||||||
return true, nil
|
return true, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// NewCurrSymbol returns a new CurrSymbol given a three-letter ISO-4217
|
||||||
|
// currency symbol as a string
|
||||||
func NewCurrSymbol(s string) (*CurrSymbol, error) {
|
func NewCurrSymbol(s string) (*CurrSymbol, error) {
|
||||||
unit, err := currency.ParseISO(s)
|
unit, err := currency.ParseISO(s)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user