1
0
mirror of https://github.com/aclindsa/ofxgo.git synced 2024-11-22 03:30:04 -05:00

cmd/ofx: go vet

This commit is contained in:
Aaron Lindsay 2017-03-28 19:47:17 -04:00
parent f51af6dd44
commit 3091a97b2c
3 changed files with 4 additions and 4 deletions

View File

@ -53,7 +53,7 @@ func getAccounts() {
return return
} }
fmt.Println("\nFound the following accounts:\n") fmt.Printf("\nFound the following accounts:\n\n")
if acctinfo, ok := response.Signup[0].(ofxgo.AcctInfoResponse); ok { if acctinfo, ok := response.Signup[0].(ofxgo.AcctInfoResponse); ok {
for _, acct := range acctinfo.AcctInfo { for _, acct := range acctinfo.AcctInfo {

View File

@ -95,7 +95,7 @@ func invTransactions() {
printInvBuy(stmt.CurDef, &tran.InvBuy) printInvBuy(stmt.CurDef, &tran.InvBuy)
case ofxgo.ClosureOpt: case ofxgo.ClosureOpt:
printInvTran(&tran.InvTran) printInvTran(&tran.InvTran)
fmt.Println("%s %s contracts (%s shares each)\n", tran.OptAction, tran.Units, tran, tran.ShPerCtrct) fmt.Printf("%s %s contracts (%d shares each)\n", tran.OptAction, tran.Units, tran.ShPerCtrct)
case ofxgo.Income: case ofxgo.Income:
printInvTran(&tran.InvTran) printInvTran(&tran.InvTran)
currency := stmt.CurDef currency := stmt.CurDef
@ -170,7 +170,7 @@ func invTransactions() {
} else if len(tran.OrigCurrency.CurSym) > 0 { } else if len(tran.OrigCurrency.CurSym) > 0 {
currency = tran.Currency.CurSym currency = tran.Currency.CurSym
} }
fmt.Printf(" %s/%s %s -> %s shares of %s %s (%s %s for fractional shares)\n", tran.Numerator, tran.Denominator, tran.OldUnits, tran.NewUnits, tran.SecId.UniqueIdType, tran.SecId.UniqueId, tran.FracCash, currency) fmt.Printf(" %d/%d %s -> %s shares of %s %s (%s %s for fractional shares)\n", tran.Numerator, tran.Denominator, tran.OldUnits, tran.NewUnits, tran.SecId.UniqueIdType, tran.SecId.UniqueId, tran.FracCash, currency)
// TODO print ticker instead of CUSIP // TODO print ticker instead of CUSIP
case ofxgo.Transfer: case ofxgo.Transfer:
printInvTran(&tran.InvTran) printInvTran(&tran.InvTran)

View File

@ -58,7 +58,7 @@ func runCmd(c *Command) {
func main() { func main() {
if len(os.Args) < 2 { if len(os.Args) < 2 {
fmt.Println("Error: Please supply a sub-command. Usage:\n") fmt.Printf("Error: Please supply a sub-command. Usage:\n\n")
usage() usage()
os.Exit(1) os.Exit(1)
} }