mirror of
https://github.com/unknwon/the-way-to-go_ZH_CN.git
synced 2025-08-12 00:11:36 +08:00
fix: fix a lot of incorrect links (#849)
This commit is contained in:
@@ -105,7 +105,7 @@ func main() {
|
||||
|
||||
any hello is a special String!
|
||||
|
||||
**练习 11.9** [simple_interface3.go](exercises\chapter_11\simple_interface3.go):
|
||||
**练习 11.9** [simple_interface3.go](exercises/chapter_11/simple_interface3.go):
|
||||
|
||||
继续练习 11.2,在它中添加一个 `gI()` 函数,它不再接受 `Simpler` 类型的参数,而是接受一个空接口参数。然后通过类型断言判断参数是否是 `Simpler` 类型。最后在 `main` 使用 `gI()` 取代 `fI()` 函数并调用它。确保你的代码足够安全。
|
||||
|
||||
@@ -141,7 +141,7 @@ func (p *Vector) Set(i int, e Element) {
|
||||
|
||||
`Vector` 中存储的所有元素都是 `Element` 类型,要得到它们的原始类型(unboxing:拆箱)需要用到类型断言。TODO:The compiler rejects assertions guaranteed to fail,类型断言总是在运行时才执行,因此它会产生运行时错误。
|
||||
|
||||
**练习 11.10** [min_interface.go](exercises\chapter_11\min_interface.go) / [minmain.go](exercises\chapter_11\minmain.go):
|
||||
**练习 11.10** [min_interface.go](exercises/chapter_11/min_interface.go) / [minmain.go](exercises/chapter_11/minmain.go):
|
||||
|
||||
仿照 11.7 中开发的 `Sorter` 接口,创建一个 `Miner` 接口并实现一些必要的操作。函数 `Min()` 接受一个 `Miner` 类型变量的集合,然后计算并返回集合中最小的元素。
|
||||
|
||||
|
Reference in New Issue
Block a user