Skip to content

Commit

Permalink
Address linter
Browse files Browse the repository at this point in the history
  • Loading branch information
merschformann committed Feb 19, 2024
1 parent 4755c01 commit 6003b22
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 7 deletions.
3 changes: 2 additions & 1 deletion solver.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,11 @@ func (s *solverWrapperImpl) Solve(
startSolutions ...Solution,
) (SolutionChannel, error) {
start := ctx.Value(run.Start).(time.Time)
ctx, _ = context.WithDeadline(
ctx, cancel := context.WithDeadline(
ctx,
start.Add(solveOptions.Duration),
)
defer cancel()
interpretedSolveOptions := SolveOptions{
Iterations: solveOptions.Iterations,
Duration: solveOptions.Duration,
Expand Down
3 changes: 2 additions & 1 deletion solver_parallel.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,11 @@ func (p *parallelSolverWrapperImpl) Solve(
startSolutions ...Solution,
) (SolutionChannel, error) {
start := ctx.Value(run.Start).(time.Time)
ctx, _ = context.WithDeadline(
ctx, cancel := context.WithDeadline(
ctx,
start.Add(solveOptions.Duration),
)
defer cancel()

interpretedParallelSolveOptions := ParallelSolveOptions{
Iterations: solveOptions.Iterations,
Expand Down
2 changes: 1 addition & 1 deletion tests/custom_matrices/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import (

"github.com/nextmv-io/nextroute"
"github.com/nextmv-io/nextroute/check"
"github.com/nextmv-io/nextroute/common"
"github.com/nextmv-io/nextroute/factory"
"github.com/nextmv-io/nextroute/schema"
"github.com/nextmv-io/sdk/common"
"github.com/nextmv-io/sdk/run"
runSchema "github.com/nextmv-io/sdk/run/schema"
)
Expand Down
2 changes: 0 additions & 2 deletions tests/golden/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ import (
"github.com/nextmv-io/sdk/golden"
)

const templateName = "nextroute"

func TestMain(m *testing.M) {
cleanUp()
golden.CopyFile("../../cmd/main.go", "main.go")
Expand Down
2 changes: 0 additions & 2 deletions tests/output_options/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ import (
"github.com/nextmv-io/sdk/golden"
)

const templateName = "nextroute"

func TestMain(m *testing.M) {
cleanUp()
golden.CopyFile("../../cmd/main.go", "main.go")
Expand Down

0 comments on commit 6003b22

Please sign in to comment.