From cf168cce6eaf2ad3d6338d30bd70151407144204 Mon Sep 17 00:00:00 2001 From: Lasse Martin Jakobsen Date: Thu, 11 Jul 2019 13:20:04 +0200 Subject: [PATCH] Update README.md Co-Authored-By: Aleksandr H --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 39e7e24..d2d6314 100644 --- a/README.md +++ b/README.md @@ -1068,7 +1068,7 @@ func NewNullWriter() io.Writer { The above function ensures that the `NullWriter` struct implements the `Writer` interface. If we were to delete the `Write` method from `NullWriter`, we would get a compilation error. This is a good way of ensuring that our code behaves as expected and that we can rely on the compiler as a safety net in case we try to write invalid code. -In certain cases, it might not be desirable to write a constructor, or perhaps we would like for our constructor to return the concrete type, rather than the interface. As an example, the `NullWriter` struct has no properties to populate on initialisation and therefore writing a constructor is a little redundant. Therefore, we can use the less verbose method of checking interface compatibility: +In certain cases, it might not be desirable to write a constructor, or perhaps we would like for our constructor to return the concrete type, rather than the interface. As an example, the `NullWriter` struct has no properties to populate on initialisation, so writing a constructor is a little redundant. Therefore, we can use the less verbose method of checking interface compatibility: ```go type Writer interface {