Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 8f697af

Browse files
committed
chore: Add comment explaining why testpackage is enabled
A discussion (linked below) was had that touched on why this linter is enabled. To avoid losing that history, adding the comment inline with our linting rules can avoid duplicating this discussion! #741 (comment)
1 parent bb6c12d commit 8f697af

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

.golangci.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,13 @@ linters:
251251
- staticcheck
252252
- structcheck
253253
- tenv
254+
# In Go, it's possible for a package to test it's internal functionality
255+
# without testing any exported functions. This is enabled to promote
256+
# decomposing a package before testing it's internals. A function caller
257+
# should be able to test most of the functionality from exported functions.
258+
#
259+
# There are edge-cases to this rule, but they should be carefully considered
260+
# to avoid structural inconsistency.
254261
- testpackage
255262
- tparallel
256263
- typecheck

0 commit comments

Comments
 (0)