mirror of
https://github.com/hanzoai/migrate.git
synced 2026-09-30 22:55:10 +00:00
Fix iofs tests
Changes:
- embedded variables must be at the package level
- re-use embedded FS in example for tests
- bump Go module version to 1.16 for tests to run
- This may cause issues building in 1.15
This commit is contained in:
@@ -64,4 +64,4 @@ require (
|
||||
modernc.org/zappy v1.0.0 // indirect
|
||||
)
|
||||
|
||||
go 1.13
|
||||
go 1.16
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
package iofs_test
|
||||
|
||||
import (
|
||||
"embed"
|
||||
"testing"
|
||||
|
||||
"github.com/golang-migrate/migrate/v4/source/iofs"
|
||||
@@ -11,8 +10,7 @@ import (
|
||||
)
|
||||
|
||||
func Test(t *testing.T) {
|
||||
//go:embed testdata/migrations/*.sql
|
||||
var fs embed.FS
|
||||
// reuse the embed.FS set in example_test.go
|
||||
d, err := iofs.New(fs, "testdata/migrations")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
|
||||
Reference in New Issue
Block a user