Embrace io.Reader

pull/151/head
Vojtech Vitek 2019-03-05 01:14:34 -05:00
parent 94c2f51496
commit 3472cd6ee8
2 changed files with 2 additions and 2 deletions

View File

@ -59,7 +59,7 @@ func (m *Migration) run(db *sql.DB, direction bool) error {
}
defer f.Close()
statements, useTx, err := parseSQLMigrationFile(f, direction)
statements, useTx, err := parseSQLMigration(f, direction)
if err != nil {
return errors.Wrapf(err, "ERROR %v: failed to parse SQL migration file", filepath.Base(m.Source))
}

View File

@ -43,7 +43,7 @@ var bufferPool = sync.Pool{
// within a statement. For these cases, we provide the explicit annotations
// 'StatementBegin' and 'StatementEnd' to allow the script to
// tell us to ignore semicolons.
func parseSQLMigrationFile(r io.Reader, direction bool) (stmts []string, useTx bool, err error) {
func parseSQLMigration(r io.Reader, direction bool) (stmts []string, useTx bool, err error) {
var buf bytes.Buffer
scanBuf := bufferPool.Get().([]byte)
defer bufferPool.Put(scanBuf)