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:
Dale Hui
2021-05-10 22:49:46 -07:00
parent bc12b336ee
commit 0826557c8e
2 changed files with 2 additions and 4 deletions
+1 -1
View File
@@ -64,4 +64,4 @@ require (
modernc.org/zappy v1.0.0 // indirect
)
go 1.13
go 1.16
+1 -3
View File
@@ -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)