mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-01-11 03:11:50 +00:00
Style fixes from go vet.
This commit is contained in:
2
Makefile
2
Makefile
@@ -36,7 +36,7 @@ coverage: coverage.out
|
||||
rm -f coverage.out
|
||||
|
||||
check:
|
||||
$(GOM) exec go tool vet -all=true -shadow=true $(ALL_PACKAGES:%=./%)
|
||||
$(GOM) exec go tool vet -all=true $(ALL_PACKAGES:%=./%)
|
||||
$(GOM) exec golint $(ALL_PACKAGES:%=./%)
|
||||
|
||||
install:
|
||||
|
||||
@@ -42,7 +42,7 @@ func aptlyRepoAdd(cmd *commander.Command, args []string) error {
|
||||
|
||||
var packageFiles, failedFiles []string
|
||||
|
||||
packageFiles, failedFiles, err = deb.CollectPackageFiles(args[1:], &aptly.ConsoleResultReporter{context.Progress()})
|
||||
packageFiles, failedFiles, err = deb.CollectPackageFiles(args[1:], &aptly.ConsoleResultReporter{Progress: context.Progress()})
|
||||
if err != nil {
|
||||
return fmt.Errorf("unable to collect package files: %s", err)
|
||||
}
|
||||
@@ -50,7 +50,7 @@ func aptlyRepoAdd(cmd *commander.Command, args []string) error {
|
||||
var processedFiles, failedFiles2 []string
|
||||
|
||||
processedFiles, failedFiles2, err = deb.ImportPackageFiles(list, packageFiles, forceReplace, verifier, context.PackagePool(),
|
||||
context.CollectionFactory().PackageCollection(), &aptly.ConsoleResultReporter{context.Progress()})
|
||||
context.CollectionFactory().PackageCollection(), &aptly.ConsoleResultReporter{Progress: context.Progress()})
|
||||
failedFiles = append(failedFiles, failedFiles2...)
|
||||
if err != nil {
|
||||
return fmt.Errorf("unable to import package files: %s", err)
|
||||
|
||||
@@ -91,7 +91,7 @@ func aptlySnapshotPull(cmd *commander.Command, args []string) error {
|
||||
return fmt.Errorf("unable to parse query: %s", err)
|
||||
}
|
||||
// Add architecture filter
|
||||
queries[i] = &deb.AndQuery{queries[i], archQuery}
|
||||
queries[i] = &deb.AndQuery{L: queries[i], R: archQuery}
|
||||
}
|
||||
|
||||
// Filter with dependencies as requested
|
||||
|
||||
@@ -23,7 +23,7 @@ func aptlyTaskRun(cmd *commander.Command, args []string) error {
|
||||
return fmt.Errorf("no such file, %s\n", filename)
|
||||
}
|
||||
|
||||
fmt.Println("Reading file...\n")
|
||||
fmt.Print("Reading file...\n\n")
|
||||
|
||||
var file *os.File
|
||||
file, err = os.Open(filename)
|
||||
|
||||
@@ -285,7 +285,6 @@ func (p *Package) GetField(name string) string {
|
||||
default:
|
||||
return p.Extra()[name]
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
// MatchesArchitecture checks whether packages matches specified architecture
|
||||
|
||||
@@ -8,13 +8,13 @@ import (
|
||||
func HumanBytes(i int64) (result string) {
|
||||
switch {
|
||||
case i > (512 * 1024 * 1024 * 1024):
|
||||
result = fmt.Sprintf("%#.02f TiB", float64(i)/1024/1024/1024/1024)
|
||||
result = fmt.Sprintf("%.02f TiB", float64(i)/1024/1024/1024/1024)
|
||||
case i > (512 * 1024 * 1024):
|
||||
result = fmt.Sprintf("%#.02f GiB", float64(i)/1024/1024/1024)
|
||||
result = fmt.Sprintf("%.02f GiB", float64(i)/1024/1024/1024)
|
||||
case i > (512 * 1024):
|
||||
result = fmt.Sprintf("%#.02f MiB", float64(i)/1024/1024)
|
||||
result = fmt.Sprintf("%.02f MiB", float64(i)/1024/1024)
|
||||
case i > 512:
|
||||
result = fmt.Sprintf("%#.02f KiB", float64(i)/1024)
|
||||
result = fmt.Sprintf("%.02f KiB", float64(i)/1024)
|
||||
default:
|
||||
result = fmt.Sprintf("%d B", i)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user