Skip to content

Commit 54f405b

Browse files
committed
comment
1 parent 8c10345 commit 54f405b

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

error_default.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ func (*noCopy) Unlock() {}
3636
// A shallow copy would inadvertently share these underlying fields,
3737
// leading to incorrect behavior and data races in a concurrent context.
3838
// Consequently, all methods take the type by pointer and not by value.
39+
//
40+
// From https://go.dev/wiki/CodeReviewComments#receiver-type:
41+
// > If the receiver is a struct, array or slice and any of its elements is a pointer to something that might be mutating,
42+
// > prefer a pointer receiver, as it will make the intention clearer to the reader.
3943
// swagger:ignore
4044
type DefaultError struct {
4145
_ noCopy

0 commit comments

Comments
 (0)