# 유연하고 테스트 가능한 Go 코드 작성하기

> Clean Markdown view of GeekNews topic #3147. Use the original source for factual precision when an external source URL is present.

## Metadata

- GeekNews HTML: [https://news.hada.io/topic?id=3147](https://news.hada.io/topic?id=3147)
- GeekNews Markdown: [https://news.hada.io/topic/3147.md](https://news.hada.io/topic/3147.md)
- Type: news
- Author: [xguru](https://news.hada.io/@xguru)
- Published: 2020-11-05T12:44:04+09:00
- Updated: 2020-11-05T12:44:04+09:00
- Original source: [medium.com](https://medium.com/daangn/how-to-write-a-testable-golang-code-4c0e67612bb8)
- Points: 17
- Comments: 0

## Topic Body

- Go 언어는 개발자에게 코딩의 즐거움을 일깨워주는 언어로 서버 코드를 작성하는데 대단히 유용

- Go의 인터페이스는 단순히 메서드의 집합일 뿐이라는 점이 특이하며 인터페이스가 어느 패키지에 존재하는지도 제약이 없음

- 이를 이용하면 실제 클라이언트에 대한 아무런 의존성 없이 모킹을 사용하여 작성한 로직을 테스트할 수 있음

- Go 언어의 독특한 인터페이스 시스템 덕분에, 복잡한 방법론을 사용하지 않더라도 보다 효율적으로 좋은 코드를 작성 가능

## Comments



_No public comments on this page._
