From f7bc37da6d2669e0bdc6ad457ac21d67163a15b8 Mon Sep 17 00:00:00 2001 From: Aleksandr H Date: Mon, 1 Jul 2019 09:15:37 -0400 Subject: [PATCH] Accept suggestion: Clarify writing on generics and interface{} Co-Authored-By: Lasse Martin Jakobsen --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 2124460..79575d9 100644 --- a/README.md +++ b/README.md @@ -1236,7 +1236,7 @@ func Println(v ...interface{}) { } ``` -In this case, `Println` isn't just accepting a single `interface{}`; rather, the function accepts a slice of types. These can be any types, not necessarily all the same. The only requirement is that all of the types implement the empty `interface{}`, which we are certain that any type will. This is a very common pattern when handling string conversation (both from and to a string). Good examples of this come from the `json` standard library package: +In this case, `Println` isn't just accepting a single `interface{}`; rather, the function accepts a slice of types that implement the empty `interface{}`. As there are no methods associated with the empty `interface{}`, all types are accepted, even making it possible to feed `Println` with a slice of different types. This is a very common pattern when handling string conversation (both from and to a string). Good examples of this come from the `json` standard library package: ```go func InsertItemHandler(w http.ResponseWriter, r *http.Request) {