Refactoring: replace sort.StringSlice with simply []string

This commit is contained in:
Andrey Smirnov
2014-02-18 14:13:18 +04:00
parent 190a81e141
commit 7864ce241b
4 changed files with 5 additions and 5 deletions

View File

@@ -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()

View File

@@ -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)

View File

@@ -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()

View File

@@ -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