mirror of
https://github.com/unknwon/the-way-to-go_ZH_CN.git
synced 2025-08-12 05:11:49 +08:00
Update 13.1.md (#474)
This commit is contained in:
@@ -15,7 +15,7 @@ type error interface {
|
||||
任何时候当你需要一个新的错误类型,都可以用 `errors`(必须先 import)包的 `errors.New` 函数接收合适的错误信息来创建,像下面这样:
|
||||
|
||||
```go
|
||||
err := errors.New(“math - square root of negative number”)
|
||||
err := errors.New("math - square root of negative number")
|
||||
```
|
||||
|
||||
在示例 13.1 中你可以看到一个简单的用例:
|
||||
|
Reference in New Issue
Block a user