parseVersionedName parses the name and version from package@version representation
(versionedName string)
| 361 | |
| 362 | // parseVersionedName parses the name and version from package@version representation |
| 363 | func parseVersionedName(versionedName string) (name, version string) { |
| 364 | var found bool |
| 365 | name, version, found = searcher.ParseVersionedPackage(versionedName) |
| 366 | if !found { |
| 367 | // Case without any @version in the versionedName |
| 368 | // We deliberately do not set version to `latest` |
| 369 | return versionedName, "" /*version*/ |
| 370 | } |
| 371 | return name, version |
| 372 | } |
| 373 | |
| 374 | // packagesFromLegacyList converts a list of strings to a list of packages |
| 375 | // Example inputs: `["python@latest", "hello", "cowsay@1"]` |