Handle Type Assertion Failures
The single return value form of a type assertion will panic on an incorrecttype. Therefore, always use the "comma ok" idiom.
Bad | Good |
---|---|
|
|
The single return value form of a type assertion will panic on an incorrecttype. Therefore, always use the "comma ok" idiom.
Bad | Good |
---|---|
|
|
本文档使用 BookStack 构建