Skip to content

Commit

Permalink
panic when a non-stmt is passed into Tx.Stmtx, fixes jmoiron#182
Browse files Browse the repository at this point in the history
  • Loading branch information
jmoiron committed Nov 14, 2015
1 parent ad7f264 commit a60eb2e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions sqlx.go
Original file line number Diff line number Diff line change
Expand Up @@ -440,6 +440,8 @@ func (tx *Tx) Stmtx(stmt interface{}) *Stmt {
s = stmt.(*Stmt).Stmt
case *sql.Stmt:
s = stmt.(*sql.Stmt)
default:
panic(fmt.Sprintf("non-statement type %v passed to Stmtx", reflect.ValueOf(stmt).Type()))
}
return &Stmt{Stmt: tx.Stmt(s), Mapper: tx.Mapper}
}
Expand Down

0 comments on commit a60eb2e

Please sign in to comment.