mirror of
https://github.com/gopl-zh/gopl-zh.github.com.git
synced 2026-01-16 20:27:15 +08:00
@@ -55,9 +55,9 @@ interface{}表示函数的最后一个参数可以接收任意类型,我们会
|
|||||||
|
|
||||||
**练习5.15:** 编写类似sum的可变参数函数max和min。考虑不传参时,max和min该如何处理,再编写至少接收1个参数的版本。
|
**练习5.15:** 编写类似sum的可变参数函数max和min。考虑不传参时,max和min该如何处理,再编写至少接收1个参数的版本。
|
||||||
|
|
||||||
**练习5.16:**编写多参数版本的strings.Join。
|
**练习5.16:** 编写多参数版本的strings.Join。
|
||||||
|
|
||||||
**练习5.17:**编写多参数版本的ElementsByTagName,函数接收一个HTML结点树以及任意数量的标签名,返回与这些标签名匹配的所有元素。下面给出了2个例子:
|
**练习5.17:** 编写多参数版本的ElementsByTagName,函数接收一个HTML结点树以及任意数量的标签名,返回与这些标签名匹配的所有元素。下面给出了2个例子:
|
||||||
|
|
||||||
```Go
|
```Go
|
||||||
func ElementsByTagName(doc *html.Node, name...string) []*html.Node
|
func ElementsByTagName(doc *html.Node, name...string) []*html.Node
|
||||||
|
|||||||
Reference in New Issue
Block a user