We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f2d2c24 commit 7bb8b6bCopy full SHA for 7bb8b6b
migrate.go
@@ -26,6 +26,7 @@ const (
26
)
27
28
var tableName = "gorp_migrations"
29
+var numberPrefixRegex = regexp.MustCompile(`^(\d+).*$`)
30
31
// Set the name of the table used to store migration info.
32
//
@@ -60,8 +61,7 @@ func (m Migration) isNumeric() bool {
60
61
}
62
63
func (m Migration) NumberPrefixMatches() []string {
- r := regexp.MustCompile(`^(\d+).*$`)
64
- return r.FindStringSubmatch(m.Id)
+ return numberPrefixRegex.FindStringSubmatch(m.Id)
65
66
67
func (m Migration) VersionInt() int64 {
0 commit comments