error() -> Error()

This commit is contained in:
Mingliang Liu
2017-06-10 01:05:36 -07:00
committed by GitHub
parent cdc2330185
commit 75a268855c

View File

@@ -226,7 +226,7 @@ Looking back to the example of Box, you will find that Color implements interfac
fmt.Println("The biggest one is", boxes.BiggestsColor().String())
fmt.Println("The biggest one is", boxes.BiggestsColor())
```
Attention: If the type implemented the interface `error`, fmt will call `error()`, so you don't have to implement Stringer at this point.
Attention: If the type implemented the interface `error`, fmt will call `Error()`, so you don't have to implement Stringer at this point.
### Type of variable in an interface