---
title: "Discussion on \"Gonerics의 아쉬운 점\" | Hashnode"
description: "Discussion on \"Gonerics의 아쉬운 점\". 트위터에 썼던 글인데 블로그 글로 쓸만한 가치가 있는 것 같아서 가져온다.\n단점:\n\n반환 타입 포지션에서 유니온 느낌의 타입 제약을 걸 수 없는 점\n\n\ntype Foo interface {\n    string|number\n}\n\nfunc foo() Foo {}\n\n이게 불가능하다는 소리다.\n\n인터페이스를 타입 제약으로 사용할 수 없는 점\n\nTagged union으로 사용할 수 없다는 소리다.\n러스트로 나타내면 간단한데...\n\n정의 오류를 사용 (캐..."
url: "https://hashnode.com/posts/2022-8-12-go-generics/662917ed032a55eb4fc8fb57"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Gonerics의 아쉬운 점](https://kdy1.dev/2022-8-12-go-generics?utm_source=hashnode&utm_medium=feed)

트위터에 썼던 글인데 블로그 글로 쓸만한 가치가 있는 것 같아서 가져온다. 단점: 반환 타입 포지션에서 유니온 느낌의 타입 제약을 걸 수 없는 점 type Foo interface { string|number } func foo() Foo {} 이게 불가능하다는 소리다. 인터페이스를 타입 제약으로 사용할 수 없는 점 Tagged union으로 사용할 수 없다는 소리다. 러스트로 나타내면 간단한데... 정의 오류를 사용 (캐...

Aug 12, 2022 · 1 min read · kdy1.dev  
Read the article

## Written by

[DongYun Kang](https://hashnode.com/@kdy1)

@kdy1 · South Korea

  
[View profile](https://hashnode.com/@kdy1)

Creator of SWC

CEO of Delino. I created SWC, an open-source compiler project, and previously worked at Deno and Vercel.

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
