Skip to content

Commit

Permalink
Fixes linting issues
Browse files Browse the repository at this point in the history
Signed-off-by: Mikalai Radchuk <mradchuk@redhat.com>
  • Loading branch information
m1kola authored and ncdc committed Jun 20, 2023
1 parent 4b09a6c commit e2b2d17
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion cmd/sudoku/sudoku.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ func NewSudoku() *Sudoku {
}
}

func (s Sudoku) GetVariables(ctx context.Context, _ input.EntitySource) ([]deppy.Variable, error) {
func (s Sudoku) GetVariables(_ context.Context, _ input.EntitySource) ([]deppy.Variable, error) {
// adapted from: https://github.com/go-air/gini/blob/871d828a26852598db2b88f436549634ba9533ff/sudoku_test.go#L10
variables := make(map[deppy.Identifier]*input.SimpleVariable, 0)
inorder := make([]deppy.Variable, 0)
Expand Down
4 changes: 2 additions & 2 deletions internal/solver/constraints.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ type zeroConstraint struct{}

var _ deppy.Constraint = zeroConstraint{}

func (zeroConstraint) String(subject deppy.Identifier) string {
func (zeroConstraint) String(_ deppy.Identifier) string {
return ""
}

func (zeroConstraint) Apply(lm deppy.LitMapping, subject deppy.Identifier) z.Lit {
func (zeroConstraint) Apply(_ deppy.LitMapping, _ deppy.Identifier) z.Lit {
return z.LitNull
}

Expand Down
2 changes: 1 addition & 1 deletion internal/solver/search.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ func (h *search) Lits() []z.Lit {
return result
}

func (h *search) Do(ctx context.Context, anchors []z.Lit) (int, []z.Lit, map[z.Lit]struct{}) {
func (h *search) Do(_ context.Context, anchors []z.Lit) (int, []z.Lit, map[z.Lit]struct{}) {
for _, m := range anchors {
h.PushChoiceBack(choice{candidates: []z.Lit{m}})
}
Expand Down
2 changes: 1 addition & 1 deletion internal/solver/solve.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const (
// containing only those Variables that were selected for
// installation. If no solution is possible, or if the provided
// Context times out or is cancelled, an error is returned.
func (s *solver) Solve(ctx context.Context) (result []deppy.Variable, err error) {
func (s *solver) Solve(_ context.Context) (result []deppy.Variable, err error) {
defer func() {
// This likely indicates a bug, so discard whatever
// return values were produced.
Expand Down
2 changes: 1 addition & 1 deletion pkg/deppy/constraint/constraint.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ func (constraint *AtMostConstraint) Ids() []deppy.Identifier {
return constraint.ids
}

func (constraint *AtMostConstraint) Apply(lm deppy.LitMapping, subject deppy.Identifier) z.Lit {
func (constraint *AtMostConstraint) Apply(lm deppy.LitMapping, _ deppy.Identifier) z.Lit {
ms := make([]z.Lit, len(constraint.ids))
for i, each := range constraint.ids {
ms[i] = lm.LitOf(each)
Expand Down
2 changes: 1 addition & 1 deletion pkg/deppy/solver/solver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,6 @@ var _ input.VariableSource = &FailingVariableSource{}
type FailingVariableSource struct {
}

func (f FailingVariableSource) GetVariables(ctx context.Context, entitySource input.EntitySource) ([]deppy.Variable, error) {
func (f FailingVariableSource) GetVariables(_ context.Context, _ input.EntitySource) ([]deppy.Variable, error) {
return nil, fmt.Errorf("error")
}

0 comments on commit e2b2d17

Please sign in to comment.