I was testing the external dependency support in one of the exercises and noticed something I wasn't aware: apparently, the Go version declared in the go.mod file affects the indirect dependencies that are downloaded. Since the exercises declare go 1.16 in their go.mod, for parity, the module controlling the dependencies should too.
Here's the problem I encountered:
I downloaded an exercise
Made the code use external dependencies
Added the dependencies to the go.mod file
Ran go mod tidy to create the go.sum file.
Ran exercism submit go.sum go..mod <solution_file>
The test run failed because it was trying to download an indirect dependency not present in the docker image
The workaround for me was:
Update the Go version of the go.mod of the exercise to match the Go version of the external-dependencies/go.mod file
Ran go mod tidy to recreate the go.sum file
Ran exercism submit go.sum go..mod <solution_file>again
The test run now passed because the go.sum now didn't have any indirect external dependency that wasn't present on the image. All due to the Go version in the go.mod of the exercise now being the same as external-dependencies/go.mod.
This PR changes external-dependencies/go.mod in a way that this workaround of changing the Go version of the exercise's go mod is not necessary.
I was testing the external dependency support in one of the exercises and noticed something I wasn't aware: apparently, the Go version declared in the
go.mod
file affects the indirect dependencies that are downloaded. Since the exercises declarego 1.16
in theirgo.mod
, for parity, the module controlling the dependencies should too.Here's the problem I encountered:
go.mod
filego mod tidy
to create thego.sum
file.exercism submit go.sum go..mod <solution_file>
The workaround for me was:
go.mod
of the exercise to match the Go version of theexternal-dependencies/go.mod
filego mod tidy
to recreate thego.sum
fileexercism submit go.sum go..mod <solution_file>
againgo.sum
now didn't have any indirect external dependency that wasn't present on the image. All due to the Go version in thego.mod
of the exercise now being the same asexternal-dependencies/go.mod
.This PR changes
external-dependencies/go.mod
in a way that this workaround of changing the Go version of the exercise'sgo mod
is not necessary.