2025년 7월 12일 토요일

Generic interfaces 요점

 https://go.dev/blog/generic-interfaces

 Generic interface를 정의할 때 최소한의 제약만을 정의하고 실제 구현체들이 자신만의 필요한 제약을 추가할 수 있도록 하는 것이 좋다.
pointer receiver를 사용해야 하는 복잡도가 증가하는 상황일 때 한번 더 생각해보자. 반드시 필요한 작업인지.

Do not over-engineer things.

 

댓글 없음:

댓글 쓰기

Generic interfaces 요점

 https://go.dev/blog/generic-interfaces  Generic interface를 정의할 때 최소한의 제약만을 정의하고 실제 구현체들이 자신만의 필요한 제약을 추가할 수 있도록 하는 것이 좋다. pointer receiver를...