The map is meant to maintain compatibility with changes in image type names. Most entries however map to themselves. It's redundant to keep updating this map with every new image type name and map it to itself. Instead, check the map for a compat string and if one doesn't exist, return the original. Conversely, when the inverse lookup is performed, first check if the compat string is a valid image type name and only iterate the map if it's not. Now we don't need to update the map every time we introduce a new image type, unless we need to map an old name to a new one. |
||
|---|---|---|
| .. | ||
| test | ||
| compose.go | ||
| fixtures.go | ||
| json.go | ||
| json_test.go | ||
| store.go | ||
| store_test.go | ||