mirror of
https://github.com/aclindsa/moneygo.git
synced 2024-12-26 07:33:21 -05:00
go vet, go fmt
This commit is contained in:
parent
f2ce7adb52
commit
85a58c3ff8
@ -162,7 +162,7 @@ func remove(client *http.Client, urlsuffix, key string) error {
|
|||||||
func RunWith(t *testing.T, d *TestData, fn TestDataFunc) {
|
func RunWith(t *testing.T, d *TestData, fn TestDataFunc) {
|
||||||
testdata, err := d.Initialize()
|
testdata, err := d.Initialize()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatal("Failed to initialize test data: %s", err)
|
t.Fatalf("Failed to initialize test data: %s", err)
|
||||||
}
|
}
|
||||||
defer func() {
|
defer func() {
|
||||||
err := testdata.Teardown()
|
err := testdata.Teardown()
|
||||||
|
@ -321,11 +321,11 @@ func OFXFileImportHandler(tx *Tx, r *http.Request, user *User, accountid int64)
|
|||||||
part, err := multipartReader.NextPart()
|
part, err := multipartReader.NextPart()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if err == io.EOF {
|
if err == io.EOF {
|
||||||
return NewError(3 /*Invalid Request*/)
|
|
||||||
log.Print("Encountered unexpected EOF")
|
log.Print("Encountered unexpected EOF")
|
||||||
|
return NewError(3 /*Invalid Request*/)
|
||||||
} else {
|
} else {
|
||||||
return NewError(999 /*Internal Error*/)
|
|
||||||
log.Print(err)
|
log.Print(err)
|
||||||
|
return NewError(999 /*Internal Error*/)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -898,7 +898,6 @@ func (i *OFXImport) AddInvTransaction(invtran *ofxgo.InvTransaction, account *Ac
|
|||||||
t, err = i.GetTransferTran(&tran, account)
|
t, err = i.GetTransferTran(&tran, account)
|
||||||
} else {
|
} else {
|
||||||
return errors.New("Unrecognized type satisfying ofxgo.InvTransaction interface: " + (*invtran).TransactionType())
|
return errors.New("Unrecognized type satisfying ofxgo.InvTransaction interface: " + (*invtran).TransactionType())
|
||||||
return nil
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -412,8 +412,8 @@ func TransactionHandler(r *http.Request, tx *Tx) ResponseWriterWriter {
|
|||||||
|
|
||||||
balanced, err := transaction.Balanced(tx)
|
balanced, err := transaction.Balanced(tx)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return NewError(999 /*Internal Error*/)
|
|
||||||
log.Print(err)
|
log.Print(err)
|
||||||
|
return NewError(999 /*Internal Error*/)
|
||||||
}
|
}
|
||||||
if !transaction.Valid() || !balanced {
|
if !transaction.Valid() || !balanced {
|
||||||
return NewError(3 /*Invalid Request*/)
|
return NewError(3 /*Invalid Request*/)
|
||||||
|
@ -34,7 +34,3 @@ func (s SuccessWriter) Write(w http.ResponseWriter) error {
|
|||||||
fmt.Fprint(w, "{}")
|
fmt.Fprint(w, "{}")
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func WriteSuccess(w http.ResponseWriter) {
|
|
||||||
fmt.Fprint(w, "{}")
|
|
||||||
}
|
|
||||||
|
Loading…
Reference in New Issue
Block a user