From eab8c21f28b5cc518abd80421eea738ba794de9a Mon Sep 17 00:00:00 2001 From: Lasse Martin Jakobsen Date: Sun, 28 Jul 2019 09:15:58 +0200 Subject: [PATCH] Update README.md Co-Authored-By: Aleksandr Hovhannisyan --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index f8e59e7..811c562 100644 --- a/README.md +++ b/README.md @@ -1188,7 +1188,7 @@ As mentioned before, the above code will compile. The `NewNullWriter` returns a > panic: runtime error: invalid memory address or nil pointer dereference -What happened? An interface method in Go is essentially a function pointer. In this case, since we are pointing to the function of an interface, rather than an actual method implementation, we are trying to invoke a function that's actually a `nil` pointer. To avoid this from happening, we would have to provide the `NulllWriter` with a struct which fulfills the interface contract, with actual implemented methods. +What happened? An interface method in Go is essentially a function pointer. In this case, since we are pointing to the function of an interface, rather than an actual method implementation, we are trying to invoke a function that's actually a `nil` pointer. To prevent this from happening, we would have to provide the `NulllWriter` with a struct that fulfills the interface contract, with actual implemented methods. ```go func main() {