| 222 | var _ MigrationSource = (*MemoryMigrationSource)(nil) |
| 223 | |
| 224 | func (m MemoryMigrationSource) FindMigrations() ([]*Migration, error) { |
| 225 | // Make sure migrations are sorted. In order to make the MemoryMigrationSource safe for |
| 226 | // concurrent use we should not mutate it in place. So `FindMigrations` would sort a copy |
| 227 | // of the m.Migrations. |
| 228 | migrations := make([]*Migration, len(m.Migrations)) |
| 229 | copy(migrations, m.Migrations) |
| 230 | sort.Sort(byId(migrations)) |
| 231 | return migrations, nil |
| 232 | } |
| 233 | |
| 234 | // A set of migrations loaded from an http.FileServer |
| 235 | |