go vet, go fmt

This commit is contained in:
Aaron Lindsay 2017-10-14 20:38:40 -04:00
parent f2ce7adb52
commit 85a58c3ff8
5 changed files with 4 additions and 9 deletions

View File

@ -162,7 +162,7 @@ func remove(client *http.Client, urlsuffix, key string) error {
func RunWith(t *testing.T, d *TestData, fn TestDataFunc) {
testdata, err := d.Initialize()
if err != nil {
t.Fatal("Failed to initialize test data: %s", err)
t.Fatalf("Failed to initialize test data: %s", err)
}
defer func() {
err := testdata.Teardown()

View File

@ -321,11 +321,11 @@ func OFXFileImportHandler(tx *Tx, r *http.Request, user *User, accountid int64)
part, err := multipartReader.NextPart()
if err != nil {
if err == io.EOF {
return NewError(3 /*Invalid Request*/)
log.Print("Encountered unexpected EOF")
return NewError(3 /*Invalid Request*/)
} else {
return NewError(999 /*Internal Error*/)
log.Print(err)
return NewError(999 /*Internal Error*/)
}
}

View File

@ -898,7 +898,6 @@ func (i *OFXImport) AddInvTransaction(invtran *ofxgo.InvTransaction, account *Ac
t, err = i.GetTransferTran(&tran, account)
} else {
return errors.New("Unrecognized type satisfying ofxgo.InvTransaction interface: " + (*invtran).TransactionType())
return nil
}

View File

@ -412,8 +412,8 @@ func TransactionHandler(r *http.Request, tx *Tx) ResponseWriterWriter {
balanced, err := transaction.Balanced(tx)
if err != nil {
return NewError(999 /*Internal Error*/)
log.Print(err)
return NewError(999 /*Internal Error*/)
}
if !transaction.Valid() || !balanced {
return NewError(3 /*Invalid Request*/)

View File

@ -34,7 +34,3 @@ func (s SuccessWriter) Write(w http.ResponseWriter) error {
fmt.Fprint(w, "{}")
return nil
}
func WriteSuccess(w http.ResponseWriter) {
fmt.Fprint(w, "{}")
}