migrate: add support for new Go io/fs.FS
This patch adds FromFS function and lets you use the new go:embed directive to add the migration files to the binary. Also, migration tests use an in memory FS impl instead of working with tmp directories.
This commit is contained in:
committed by
Michal Jan Matczuk
parent
7980a955be
commit
fe1498fe13
@@ -4,10 +4,13 @@
|
||||
|
||||
package migrate
|
||||
|
||||
import "testing"
|
||||
import (
|
||||
"os"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestFileChecksum(t *testing.T) {
|
||||
c, err := fileChecksum("testdata/file")
|
||||
c, err := fileChecksum(os.DirFS("testdata"), "file")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user