mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-04-19 19:28:22 +00:00
Refactoring: replace sort.StringSlice with simply []string
This commit is contained in:
@@ -58,7 +58,7 @@ func aptlyMirrorList(cmd *commander.Command, args []string) error {
|
||||
|
||||
if repoCollection.Len() > 0 {
|
||||
fmt.Printf("List of mirrors:\n")
|
||||
repos := make(sort.StringSlice, repoCollection.Len())
|
||||
repos := make([]string, repoCollection.Len())
|
||||
i := 0
|
||||
repoCollection.ForEach(func(repo *debian.RemoteRepo) error {
|
||||
repos[i] = repo.String()
|
||||
|
||||
@@ -141,7 +141,7 @@ func aptlyPublishList(cmd *commander.Command, args []string) error {
|
||||
return err
|
||||
}
|
||||
|
||||
published := make(sort.StringSlice, 0, publishedCollecton.Len())
|
||||
published := make([]string, 0, publishedCollecton.Len())
|
||||
|
||||
err = publishedCollecton.ForEach(func(repo *debian.PublishedRepo) error {
|
||||
err := publishedCollecton.LoadComplete(repo, snapshotCollection)
|
||||
|
||||
@@ -71,7 +71,7 @@ func aptlySnapshotList(cmd *commander.Command, args []string) error {
|
||||
if snapshotCollection.Len() > 0 {
|
||||
fmt.Printf("List of snapshots:\n")
|
||||
|
||||
snapshots := make(sort.StringSlice, snapshotCollection.Len())
|
||||
snapshots := make([]string, snapshotCollection.Len())
|
||||
|
||||
i := 0
|
||||
snapshotCollection.ForEach(func(snapshot *debian.Snapshot) error {
|
||||
@@ -195,7 +195,7 @@ func aptlySnapshotVerify(cmd *commander.Command, args []string) error {
|
||||
fmt.Printf("All dependencies are satisfied.\n")
|
||||
} else {
|
||||
fmt.Printf("Missing dependencies (%d):\n", len(missing))
|
||||
deps := make(sort.StringSlice, len(missing))
|
||||
deps := make([]string, len(missing))
|
||||
i := 0
|
||||
for _, dep := range missing {
|
||||
deps[i] = dep.String()
|
||||
|
||||
@@ -66,7 +66,7 @@ func StrSliceHasItem(s []string, item string) bool {
|
||||
|
||||
// StrMapSortedKeys returns keys of map[string]string sorted
|
||||
func StrMapSortedKeys(m map[string]string) []string {
|
||||
keys := make(sort.StringSlice, len(m))
|
||||
keys := make([]string, len(m))
|
||||
i := 0
|
||||
for k := range m {
|
||||
keys[i] = k
|
||||
|
||||
Reference in New Issue
Block a user