[x/website/_content/tour] Unit tests for "A Tour of Go"

20 views
Skip to first unread message

Anthony Accioly

unread,
Mar 22, 2026, 4:23:41 PM (14 hours ago) Mar 22
to golang-dev

Hi Go community and maintainers,

I hope this email finds you well.

If this isn’t the right place to discuss this, please let me know. I’m also happy to open an issue at https://go.dev/issues if needed,  but for now this feels less like an issue and more like a "is this useful to you?" email.

To get to the point: I’ve created a complete solution set for all Tour examples and exercises, including unit tests with 100% code coverage. You can find it here: https://github.com/aaccioly-coding-challenges/golang-tour-solutions

The tests primarily capture the output of each example’s main function and assert against it. In some cases, they do a bit more to achieve full coverage where invoking main alone isn’t sufficient.

I’m reaching out to see if this test suite could be useful to the Go project itself. For example, it could potentially be used to catch regressions and verify that Tour examples and solutions continue to work with newer Go versions, or to support a future feature to validate user solutions, similar to https://play.kotlinlang.org/koans.

I’ve noticed that the official examples and solutions are marked with //go:build OMIT, for example:

Are these examples currently untested, or are they built and validated elsewhere?

If they aren’t covered by tests, I’d be happy to adapt and contribute this test suite in a way that fits the project.

Please let me know if this would be useful.

Cheers,
--
Anthony Accioly

Reply all
Reply to author
Forward
0 new messages