CrunchyData / postgres-operator

Production PostgreSQL for Kubernetes, from high availability Postgres clusters to full-scale database-as-a-service.
https://access.crunchydata.com/documentation/postgres-operator/v5/
Apache License 2.0
3.96k stars 594 forks source link

Refactor: Consistently use either pointer or value receivers #4033

Closed cbandy closed 1 week ago

cbandy commented 1 week ago

Subtle bugs can arise when mixing the two. A type is more coherent when it behaves as only one of (1) a value or (2) a reference.

A new linter identifies this situation but does not yet account for unmarshal methods on value types.

Checklist:

Type of Changes:

Other Information:

See https://go.dev/wiki/CodeReviewComments#receiver-type and https://go.dev/wiki/MethodSets