# Testing (Go) > testing package, test tables, benchmarks, examples, coverage, testify, mocking - 22 면접 질문 - Mid-Level - [면접 질문: Go](https://sharpskill.dev/ko/technologies/go/interview-questions.md) ## 1. Go에서 테스트 파일의 명명 규칙은 무엇입니까? **답변** Go에서 테스트 파일은 _test.go 접미사를 가져야 하며 테스트 대상 코드와 동일한 package에 위치해야 합니다. 예를 들어 main.go를 테스트하려면 main_test.go를 만듭니다. 이 규칙 덕분에 go test 명령은 추가 설정 없이 테스트 파일을 자동으로 발견할 수 있습니다. ## 2. Go에서 테스트 함수의 올바른 시그니처는 무엇입니까? **답변** Go의 테스트 함수는 Test로 시작하고 *testing.T 타입의 매개변수 하나만 받으며 아무것도 반환하지 않아야 합니다. export되려면 이름이 대문자로 시작해야 합니다. 예를 들어 func TestAdd(t *testing.T)입니다. t 매개변수를 통해 t.Error, t.Fail, t.Fatal 등으로 실패를 알릴 수 있습니다. ## 3. t.Error와 t.Fatal의 차이점은 무엇입니까? **답변** t.Error는 테스트를 실패로 표시하지만 테스트 실행을 계속하여 여러 오류를 감지할 수 있습니다. t.Fatal은 테스트를 실패로 표시하고 현재 테스트의 실행을 즉시 중단합니다. setup 실패나 예상치 못한 nil 값처럼 중요한 전제 조건이 실패하여 계속하는 것이 의미 없을 때 t.Fatal을 사용합니다. ## 19개 추가 질문 이용 가능 - TestAdd라는 이름의 특정 테스트만 실행하려면 어떻게 합니까? - Go에서 table-driven test란 무엇입니까? 무료로 가입하기: https://sharpskill.dev/ko/login ## 기타 Go 면접 주제 - [Go 기초](https://sharpskill.dev/ko/technologies/go/interview-questions/go-basics.md): 25개 질문, Junior - [Go 데이터 구조](https://sharpskill.dev/ko/technologies/go/interview-questions/go-data-structures.md): 20개 질문, Junior - [Go 인터페이스](https://sharpskill.dev/ko/technologies/go/interview-questions/go-interfaces.md): 18개 질문, Junior - [에러 처리](https://sharpskill.dev/ko/technologies/go/interview-questions/error-handling.md): 20개 질문, Junior - [Goroutine 기초](https://sharpskill.dev/ko/technologies/go/interview-questions/goroutines-basics.md): 20개 질문, Junior - [Channels](https://sharpskill.dev/ko/technologies/go/interview-questions/channels.md): 22개 질문, Junior - [Go Modules](https://sharpskill.dev/ko/technologies/go/interview-questions/go-modules.md): 18개 질문, Mid-Level - [HTTP 서버](https://sharpskill.dev/ko/technologies/go/interview-questions/http-server.md): 24개 질문, Mid-Level - [HTTP 클라이언트](https://sharpskill.dev/ko/technologies/go/interview-questions/http-client.md): 18개 질문, Mid-Level - [JSON 인코딩](https://sharpskill.dev/ko/technologies/go/interview-questions/json-encoding.md): 20개 질문, Mid-Level - [Database/SQL](https://sharpskill.dev/ko/technologies/go/interview-questions/database-sql.md): 22개 질문, Mid-Level - [context 패키지](https://sharpskill.dev/ko/technologies/go/interview-questions/context-package.md): 20개 질문, Mid-Level - [동시성 패턴](https://sharpskill.dev/ko/technologies/go/interview-questions/concurrency-patterns.md): 24개 질문, Mid-Level - [동기화 프리미티브](https://sharpskill.dev/ko/technologies/go/interview-questions/sync-primitives.md): 22개 질문, Mid-Level - [Go 웹 프레임워크](https://sharpskill.dev/ko/technologies/go/interview-questions/go-web-frameworks.md): 20개 질문, Mid-Level - [REST API 설계](https://sharpskill.dev/ko/technologies/go/interview-questions/rest-api-design.md): 20개 질문, Mid-Level - [gRPC](https://sharpskill.dev/ko/technologies/go/interview-questions/grpc.md): 22개 질문, Mid-Level - [Reflection](https://sharpskill.dev/ko/technologies/go/interview-questions/reflection.md): 20개 질문, Senior - [메모리 관리](https://sharpskill.dev/ko/technologies/go/interview-questions/memory-management.md): 24개 질문, Senior - [성능 최적화](https://sharpskill.dev/ko/technologies/go/interview-questions/performance-optimization.md): 22개 질문, Senior - [Generics](https://sharpskill.dev/ko/technologies/go/interview-questions/generics.md): 20개 질문, Senior - [Go Design Patterns](https://sharpskill.dev/ko/technologies/go/interview-questions/design-patterns.md): 24개 질문, Senior - [Microservices](https://sharpskill.dev/ko/technologies/go/interview-questions/microservices.md): 24개 질문, Senior - [보안 및 인증](https://sharpskill.dev/ko/technologies/go/interview-questions/security-authentication.md): 24개 질문, Senior - [Docker & Containerization](https://sharpskill.dev/ko/technologies/go/interview-questions/docker-containerization.md): 20개 질문, Senior - [Kubernetes Basics](https://sharpskill.dev/ko/technologies/go/interview-questions/kubernetes-basics.md): 22개 질문, Senior - [고급 Go](https://sharpskill.dev/ko/technologies/go/interview-questions/advanced-go.md): 20개 질문, Senior - [CLI 개발](https://sharpskill.dev/ko/technologies/go/interview-questions/cli-development.md): 20개 질문, Senior --- Source: SharpSkill (https://sharpskill.dev), tech interview preparation for your real stack. HTML version of this page: https://sharpskill.dev/ko/technologies/go/interview-questions/testing