Skip to content
This repository has been archived by the owner on Apr 13, 2024. It is now read-only.

Update methods.article #391

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion content/methods.article
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ nil 接口值既不保存值也不保存具体类型。

该语句断言接口值 `i` 保存了具体类型 `T`,并将其底层类型为 `T` 的值赋予变量 `t`。

若 `i` 并未保存 `T` 类型的值,该语句就会触发一个恐慌
若 `i` 并未保存 `T` 类型的值,该语句就会触发一个 panic 异常

为了 *判断* 一个接口值是否保存了一个特定的类型,类型断言可返回两个值:其底层值以及一个报告断言是否成功的布尔值。

Expand Down