Minor cleanups to keep the linter happy

* Unexported:
  - QuestionCallback
  - SliceToStringSet

* Unreachable return in parser.go

* Unneded else in dependencies.go

* Punctuation in error message in install.go
This commit is contained in:
Sergio Correia 2018-03-19 11:30:44 -04:00
parent a5b5cc38ee
commit 9f62663888
No known key found for this signature in database
GPG key ID: CE624C7096FE4BB6
5 changed files with 6 additions and 9 deletions

View file

@ -4,7 +4,7 @@ import (
alpm "github.com/jguer/go-alpm"
)
func QuestionCallback(question alpm.QuestionAny) {
func questionCallback(question alpm.QuestionAny) {
q, err := question.QuestionInstallIgnorepkg()
if err == nil {
q.SetInstall(true)

2
cmd.go
View file

@ -224,7 +224,7 @@ func initAlpm() (err error) {
return
}
alpmHandle.SetQuestionCallback(QuestionCallback)
alpmHandle.SetQuestionCallback(questionCallback)
return
}

View file

@ -63,9 +63,8 @@ func splitDbFromName(pkg string) (string, string) {
if len(split) == 2 {
return split[0], split[1]
} else {
return "", split[0]
}
return "", split[0]
}
// Step two of dependency resolving. We already have all the information on the

View file

@ -145,7 +145,7 @@ func install(parser *arguments) error {
if !parser.existsArg("gendb") && len(arguments.targets) > 0 {
err := passToPacman(arguments)
if err != nil {
return fmt.Errorf("Error installing repo packages.")
return fmt.Errorf("Error installing repo packages")
}
depArguments := makeArguments()

View file

@ -39,7 +39,7 @@ func (set stringSet) toSlice() []string {
return slice
}
func SliceToStringSet(in []string) stringSet {
func sliceToStringSet(in []string) stringSet {
set := make(stringSet)
for _, v := range in {
@ -50,7 +50,7 @@ func SliceToStringSet(in []string) stringSet {
}
func makeStringSet(in ...string) stringSet {
return SliceToStringSet(in)
return sliceToStringSet(in)
}
// Parses command line arguments in a way we can interact with programmatically but
@ -519,8 +519,6 @@ func (parser *arguments) parseStdin() (err error) {
parser.addTarget(target)
}
return
}
func (parser *arguments) parseCommandLine() (err error) {