From: Anderson A. Giacomolli Date: Sat, 7 Nov 2026 17:57:37 +0000 (-0300) Subject: Name the test files that hold only shared helpers X-Git-Url: http://git.giacomolli.uk/onechat/commitdiff_plain/1379d7d0d0173416237ddf8ebe820743d2cecfa6?ds=sidebyside Name the test files that hold only shared helpers A helper that one test file uses stays in that file. A helper that more than one test file uses goes into a file without tests, whose name says what it holds and ends with _helper_test.go. The name then shows that the file has no tests, and a file named for one type does not seem to test a feature of that name. --- diff --git a/.agents/skills/go-code/SKILL.md b/.agents/skills/go-code/SKILL.md index edaf377..3d9e3f3 100644 --- a/.agents/skills/go-code/SKILL.md +++ b/.agents/skills/go-code/SKILL.md @@ -92,5 +92,8 @@ description: Go style rules. Use before you write or review Go code. input. - In a test file, put constants immediately after the imports, then the tests, then supporting types, methods, and helpers. +- Keep a helper that only one test file uses in that file. Put a helper + that more than one test file uses in a file without tests. Name that + file for what it holds, and end the name with `_helper_test.go`. - Supply valid required dependencies in tests. Do not make a dependency optional only to make a test simpler.