# 에러 처리 (Go) > Error type, error wrapping, errors.Is, errors.As, custom errors, panic/recover - 20 면접 질문 - Junior - [면접 질문: Go](https://sharpskill.dev/ko/technologies/go/interview-questions.md) ## 1. Go에서 에러를 표현하는 데 사용되는 인터페이스는 무엇입니까? **답변** error 인터페이스는 Go에서 에러 상태를 표현하기 위한 사전 정의된 인터페이스입니다. 에러를 설명하는 문자열을 반환하는 Error() 메서드 하나만 포함합니다. nil 값은 에러가 없음을 나타냅니다. 이는 표준 라이브러리의 모든 패키지와 Go 개발자가 에러를 알리고 전파하기 위해 사용하는 관례적인 인터페이스입니다. ## 2. Go에서 정적 메시지를 가진 간단한 에러를 어떻게 생성합니까? **답변** errors 패키지의 errors.New() 함수는 정적 메시지를 가진 간단한 에러를 생성합니다. 제공된 메시지로 error 인터페이스를 구현하는 error 타입을 반환합니다. 이 방식은 sentinel 에러(os.ErrNotExist 같은 사전 정의된 에러)나 동적 컨텍스트가 없는 간단한 에러를 생성하는 데 권장됩니다. 동적 메시지에는 fmt.Errorf()를 사용하세요. ## 3. 동적으로 포맷된 메시지를 가진 에러를 생성할 수 있는 함수는 무엇입니까? **답변** fmt.Errorf() 함수는 포맷 동사(%s, %d, %v 등)를 사용하여 동적으로 포맷된 메시지를 가진 에러를 생성합니다. 또한 기존 에러를 래핑하기 위한 특수 동사 %w를 지원하여 나중에 검사할 수 있도록 에러 체인을 보존합니다. 이는 원래 에러를 유지하면서 에러에 컨텍스트를 추가하는 권장 방법입니다. ## 17개 추가 질문 이용 가능 - fmt.Errorf()로 에러를 래핑할 수 있는 포맷 동사는 무엇입니까? - 래핑된 에러가 특정 에러와 일치하는지 확인하는 함수는 무엇입니까? 무료로 가입하기: 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 - [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 - [Testing](https://sharpskill.dev/ko/technologies/go/interview-questions/testing.md): 22개 질문, 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/error-handling