From 4a1c6bedfca712e3278d8447965787cda9d1ed25 Mon Sep 17 00:00:00 2001 From: Sunil Joshi <4852488+c0dehu1k@users.noreply.github.com> Date: Thu, 5 Oct 2023 21:24:55 +0530 Subject: [PATCH] fixed typo with command quotes --- docs/9-generics.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/9-generics.md b/docs/9-generics.md index 960f6a6..ca869ba 100644 --- a/docs/9-generics.md +++ b/docs/9-generics.md @@ -80,7 +80,7 @@ To handle the map, we defined two kinds of type parameters. First, the values ca var m map[[]byte]int ``` -This code leads to a compilation error: `invalid map key type []byte`. Therefore, instead of accepting any key type, we are obliged to restrict type arguments so that the key type meets specific requirements. Here, being comparable (we can use `==` or `!=`). Hence, we defined `K` as `comparable` instead of `a``ny`. +This code leads to a compilation error: `invalid map key type []byte`. Therefore, instead of accepting any key type, we are obliged to restrict type arguments so that the key type meets specific requirements. Here, being comparable (we can use `==` or `!=`). Hence, we defined `K` as `comparable` instead of `any`. Restricting type arguments to match specific requirements is called a constraint. A constraint is an interface type that can contain: