mirror of
https://github.com/Pungyeon/clean-go-article.git
synced 2024-11-23 14:14:05 +00:00
Update README.md
Co-Authored-By: Aleksandr H <aleksandrhovhannisyan@gmail.com>
This commit is contained in:
parent
cf168cce6e
commit
8530359ce4
|
@ -1087,7 +1087,7 @@ var _ io.Writer = &NullWriter{}
|
||||||
var _ io.Reader = &NullWriter{}
|
var _ io.Reader = &NullWriter{}
|
||||||
```
|
```
|
||||||
|
|
||||||
From the above code, it's very easy to understand which interfaces must be fulfilled and will ensure that the compiler is helping us out on compile time. Therefore, this is generally the preferred solution for checking interface contract fulfillment.
|
From the above code, it's very easy to understand which interfaces must be fulfilled; this ensures that the compiler will help us out during compile time. Therefore, this is generally the preferred solution for checking interface contract fulfillment.
|
||||||
|
|
||||||
There's yet another method of trying to be more explicit about which interfaces a given struct implements. However, this third method actually achieves the opposite of what we want. It involves using embedded interfaces as a struct property.
|
There's yet another method of trying to be more explicit about which interfaces a given struct implements. However, this third method actually achieves the opposite of what we want. It involves using embedded interfaces as a struct property.
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue