mirror of
https://github.com/Pungyeon/clean-go-article.git
synced 2024-11-10 01:14:04 +00:00
Typo fix
This commit is contained in:
parent
1f5e6b3f04
commit
efe7d709b3
|
@ -1236,7 +1236,7 @@ func Println(v ...interface{}) {
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
In this case, `Println` isn't just accepting a single `interface{}`; rather, the function accepts a <em>slice</em> of types that implement the empty `interface{}`. As there are no methods associated with the empty `interface{}`, <em>all</em> 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:
|
In this case, `Println` isn't just accepting a single `interface{}`; rather, the function accepts a <em>slice</em> of types that implement the empty `interface{}`. As there are no methods associated with the empty `interface{}`, <em>all</em> 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 conversion (both from and to a string). Good examples of this come from the `json` standard library package:
|
||||||
|
|
||||||
```go
|
```go
|
||||||
func InsertItemHandler(w http.ResponseWriter, r *http.Request) {
|
func InsertItemHandler(w http.ResponseWriter, r *http.Request) {
|
||||||
|
|
Loading…
Reference in a new issue