From 3091a97b2c024f2eada57eef89cb2023e12a58ec Mon Sep 17 00:00:00 2001 From: Aaron Lindsay Date: Tue, 28 Mar 2017 19:47:17 -0400 Subject: [PATCH] cmd/ofx: go vet --- cmd/ofx/get_accounts.go | 2 +- cmd/ofx/invtransactions.go | 4 ++-- cmd/ofx/main.go | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cmd/ofx/get_accounts.go b/cmd/ofx/get_accounts.go index 14841ed..1b99ef4 100644 --- a/cmd/ofx/get_accounts.go +++ b/cmd/ofx/get_accounts.go @@ -53,7 +53,7 @@ func getAccounts() { 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 { for _, acct := range acctinfo.AcctInfo { diff --git a/cmd/ofx/invtransactions.go b/cmd/ofx/invtransactions.go index 5ca74cf..35e3149 100644 --- a/cmd/ofx/invtransactions.go +++ b/cmd/ofx/invtransactions.go @@ -95,7 +95,7 @@ func invTransactions() { printInvBuy(stmt.CurDef, &tran.InvBuy) case ofxgo.ClosureOpt: 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: printInvTran(&tran.InvTran) currency := stmt.CurDef @@ -170,7 +170,7 @@ func invTransactions() { } else if len(tran.OrigCurrency.CurSym) > 0 { 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 case ofxgo.Transfer: printInvTran(&tran.InvTran) diff --git a/cmd/ofx/main.go b/cmd/ofx/main.go index 0baceec..4d30c2e 100644 --- a/cmd/ofx/main.go +++ b/cmd/ofx/main.go @@ -58,7 +58,7 @@ func runCmd(c *Command) { func main() { 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() os.Exit(1) }