Skip to content

Commit

Permalink
Minor cleanups to keep the linter happy
Browse files Browse the repository at this point in the history
* Unexported:
  - QuestionCallback
  - SliceToStringSet

* Unreachable return in parser.go

* Unneded else in dependencies.go

* Punctuation in error message in install.go
  • Loading branch information
qrwteyrutiyoup committed Mar 19, 2018
1 parent a5b5cc3 commit 9f62663
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 9 deletions.
2 changes: 1 addition & 1 deletion callbacks.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ func initAlpm() (err error) {
return
}

alpmHandle.SetQuestionCallback(QuestionCallback)
alpmHandle.SetQuestionCallback(questionCallback)

return
}
Expand Down
3 changes: 1 addition & 2 deletions dependencies.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion install.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
6 changes: 2 additions & 4 deletions parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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
Expand Down Expand Up @@ -519,8 +519,6 @@ func (parser *arguments) parseStdin() (err error) {

parser.addTarget(target)
}

return
}

func (parser *arguments) parseCommandLine() (err error) {
Expand Down

0 comments on commit 9f62663

Please sign in to comment.