Rename Creator interface.
This commit is contained in:
parent
0cea9b1edc
commit
7863284e61
1 changed files with 4 additions and 4 deletions
|
@ -25,8 +25,8 @@ type Transactor interface {
|
|||
Executor
|
||||
}
|
||||
|
||||
// Creator starts transactions.
|
||||
type Creator interface {
|
||||
// Beginner begins transactions.
|
||||
type Beginner interface {
|
||||
Begin() (*sql.Tx, error)
|
||||
}
|
||||
|
||||
|
@ -41,9 +41,9 @@ var DebugWriter = os.Stdout
|
|||
|
||||
// Begin a transaction
|
||||
func Begin() (Transactor, error) {
|
||||
creator, ok := currentDB.(Creator)
|
||||
creator, ok := currentDB.(Beginner)
|
||||
if !ok {
|
||||
panic("Your database does not support transactions.")
|
||||
panic("database does not support transactions")
|
||||
}
|
||||
|
||||
return creator.Begin()
|
||||
|
|
Loading…
Add table
Reference in a new issue