mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-05-30 04:20:53 +00:00
Style fixes as suggested by tools.
This commit is contained in:
@@ -18,8 +18,8 @@ type snapshotListToSort struct {
|
|||||||
sortMethod int
|
sortMethod int
|
||||||
}
|
}
|
||||||
|
|
||||||
func ParseSortMethod(sortMethod_string string) (int, error) {
|
func parseSortMethod(sortMethod string) (int, error) {
|
||||||
switch sortMethod_string {
|
switch sortMethod {
|
||||||
case "time", "Time":
|
case "time", "Time":
|
||||||
return SortTime, nil
|
return SortTime, nil
|
||||||
case "name", "Name":
|
case "name", "Name":
|
||||||
@@ -55,11 +55,11 @@ func aptlySnapshotList(cmd *commander.Command, args []string) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
raw := cmd.Flag.Lookup("raw").Value.Get().(bool)
|
raw := cmd.Flag.Lookup("raw").Value.Get().(bool)
|
||||||
sortMethod_string := cmd.Flag.Lookup("sort").Value.Get().(string)
|
sortMethodString := cmd.Flag.Lookup("sort").Value.Get().(string)
|
||||||
|
|
||||||
snapshotsToSort := &snapshotListToSort{}
|
snapshotsToSort := &snapshotListToSort{}
|
||||||
snapshotsToSort.list = make([]*deb.Snapshot, context.CollectionFactory().SnapshotCollection().Len())
|
snapshotsToSort.list = make([]*deb.Snapshot, context.CollectionFactory().SnapshotCollection().Len())
|
||||||
snapshotsToSort.sortMethod, err = ParseSortMethod(sortMethod_string)
|
snapshotsToSort.sortMethod, err = ParseSortMethod(sortMethodString)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-3
@@ -18,8 +18,7 @@ func (c *containsChecker) Check(params []interface{}, names []string) (result bo
|
|||||||
ok bool
|
ok bool
|
||||||
)
|
)
|
||||||
|
|
||||||
pkgMap := make (map[*Package]bool)
|
pkgMap := make(map[*Package]bool)
|
||||||
|
|
||||||
|
|
||||||
pkgSlice1, ok = params[0].([]*Package)
|
pkgSlice1, ok = params[0].([]*Package)
|
||||||
if !ok {
|
if !ok {
|
||||||
@@ -42,7 +41,7 @@ func (c *containsChecker) Check(params []interface{}, names []string) (result bo
|
|||||||
return true, ""
|
return true, ""
|
||||||
}
|
}
|
||||||
|
|
||||||
var Contains Checker = &containsChecker{&CheckerInfo{Name: "Contains", Params: []string{"Container", "Expected to contain"}}}
|
var Contains = &containsChecker{&CheckerInfo{Name: "Contains", Params: []string{"Container", "Expected to contain"}}}
|
||||||
|
|
||||||
type PackageListSuite struct {
|
type PackageListSuite struct {
|
||||||
// Simple list with "real" packages from stanzas
|
// Simple list with "real" packages from stanzas
|
||||||
|
|||||||
Reference in New Issue
Block a user