인 것을 권장하면서 상속을 피하도록 설계되었다. 이 장에서는 타입, 메서드, 인터페이스를 살
펴보고 이를 사용하여 테스트 및 유지관리가 용이한 프로그램을 만드는 방법을 살펴보도록 하자.
7.1
Go
의 타입
3
.
5
절 ‘구조체’에서 구조체 타입을 정의한 방법을 보았다.
type Person struct {
FirstName string
LastName string
Age int
}
타입, 메서드, 인터페이스
CHAPTER
7
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month, and much more.