Remove removes a package from the list of packages
(versionedName string)
| 35 | |
| 36 | // Remove removes a package from the list of packages |
| 37 | func (pkgs *PackagesMutator) Remove(versionedName string) { |
| 38 | name, version := parseVersionedName(versionedName) |
| 39 | i := pkgs.index(name, version) |
| 40 | if i == -1 { |
| 41 | return |
| 42 | } |
| 43 | pkgs.collection = slices.Delete(pkgs.collection, i, i+1) |
| 44 | pkgs.ast.removePackage(name) |
| 45 | } |
| 46 | |
| 47 | // AddPlatforms adds a platform to the list of platforms for a given package |
| 48 | func (pkgs *PackagesMutator) AddPlatforms(writer io.Writer, versionedname string, platforms []string) error { |