Replacing `interface{}` with `any`

I was mentoring a Linked List solution, and realized that the template for the exercise still uses interface{} instead of any. Across the Go track, there are just over a hundred instances of this. I started to put together a PR for this, until I read that community contributions are not accepted.

The any alias was introduced in 1.18, and has since become the standard for new code. This difference is also flagged by a common linter, built into the golangci-lint package. There is no difference in logic, so this change should have negligible risk of breaking things.

Exercism supports Go 1.2 and higher.

Until the ā€œbaseā€ version is bumped, I don’t think newer features can be depended upon.

1 Like

1.2 was released in 2013. I wonder if that doc is potentially out of date, but I don’t know the specifics of the testing setup.

The test runner uses 1.25.

Looking at a random exercise, the default is 1.23.

I’m not entirely sure how Go versioning works but I think users can put much earlier versions in the go.mod file.

The Go track was recently updated to support 1.23 in the go.mod and 1.25 for the runners.

1 Like

Any other concerns?

Does someone in particular need to sign off before I propose a PR?

The track maintainer needs to sign off.

Paging @andrerfcsantos

@bernot-dev Feel free to open a PR and link it here. It’ll get closed but I can reopen and review.

Merged! Thanks for this.

1 Like