Files
go-mocket/result.go
T
Alexandre Vallières-LagacéandAlexandre Vallières-Lagacé 0f12e25bc0 Fixed linter errors from goreportcard
Fixed simple naming, comment conventions
Fixed pointer references to a struc where there was also a pointer. Govet complain was right.
2018-10-29 09:17:11 -04:00

27 lines
641 B
Go

package gomocket
import (
"database/sql/driver"
)
// FakeResult implementation of sql Result interface
type FakeResult struct {
insertID int64
rowsAffected int64
}
// NewFakeResult returns result interface instance
func NewFakeResult(insertID int64, rowsAffected int64) driver.Result {
return &FakeResult{insertID, rowsAffected}
}
// LastInsertId required to give sql package ability get ID of inserted record
func (fr *FakeResult) LastInsertId() (int64, error) {
return fr.insertID, nil
}
// RowsAffected returns the number of rows affected
func (fr *FakeResult) RowsAffected() (int64, error) {
return fr.rowsAffected, nil
}