(dir http.FileSystem, root string, info os.FileInfo)
| 286 | } |
| 287 | |
| 288 | func migrationFromFile(dir http.FileSystem, root string, info os.FileInfo) (*Migration, error) { |
| 289 | path := path.Join(root, info.Name()) |
| 290 | file, err := dir.Open(path) |
| 291 | if err != nil { |
| 292 | return nil, fmt.Errorf("Error while opening %s: %w", info.Name(), err) |
| 293 | } |
| 294 | defer func() { _ = file.Close() }() |
| 295 | |
| 296 | migration, err := ParseMigration(info.Name(), file) |
| 297 | if err != nil { |
| 298 | return nil, fmt.Errorf("Error while parsing %s: %w", info.Name(), err) |
| 299 | } |
| 300 | return migration, nil |
| 301 | } |
| 302 | |
| 303 | // Migrations from a bindata asset set. |
| 304 | type AssetMigrationSource struct { |
no test coverage detected
searching dependent graphs…