Skip to content

Support external dependencies in the Go track #2379

@andrerfcsantos

Description

@andrerfcsantos

This issue is meant as a discussion and tracking issue for the support of external dependencies in the Go track.

Current state

Right now the test-runners run in a container with no network access, which makes the use of external dependencies not possible at the moment.

Possible solution

A possible solution is to have a list of allowed external dependencies in a file, and make the Dockerfile of the test runner fetch those dependencies when building the image. That way, if a student uses an external dependency in a solution, the test runner (and other tooling) can use the local copy it has pre-built in the image instead of trying to fetch it on the fly, hence requiring no network access.

The Rust track currently does this. Here's an example of the Rust test-runner Dockerfile:
https://github.com/exercism/rust-test-runner/blob/e343e83b35badd61391d86b17d2adbd42f534c3f/Dockerfile#L15-L19

List of allowed dependencies

The list of allowed dependencies is something that we still want feedback on. Some things that were discussed before as possibly good candidates:

  • stretchr/testify - we could use it on our tests to simplify some logic, and students could use it too for some debugging possibly
  • golang.org/x/* packages - extension packages, some contain useful things.
  • Generic libraries - with the advent of generics,some useful libraries commonly used by the community might appear. An example of a library with such potential would be samber/lo.

Metadata

Metadata

Assignees

No one assigned

    Labels

    discussionThis is a topic for a longer discussion. The issue can stay open for a while.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions