Skip to content

Commit 011dc47

Browse files
jufemaizrubenv
andauthored
Feedback from @rubenv
strings.TrimPrefix to avoid a double slash Co-Authored-By: Ruben Vermeersch <ruben@rocketeer.be>
1 parent 1876455 commit 011dc47

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

migrate.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ func findMigrations(dir http.FileSystem) ([]*Migration, error) {
275275
}
276276

277277
func migrationFromFile(dir http.FileSystem, info os.FileInfo) (*Migration, error) {
278-
path := fmt.Sprintf("/%s", info.Name())
278+
path := fmt.Sprintf("/%s", strings.TrimPrefix(info.Name(), "/"))
279279
file, err := dir.Open(path)
280280
if err != nil {
281281
return nil, fmt.Errorf("Error while opening %s: %s", info.Name(), err)

0 commit comments

Comments
 (0)