From 4cf547665e35347a9f15d9391257d5c512eabbc5 Mon Sep 17 00:00:00 2001 From: BuTn <44598964+kimmosc2@users.noreply.github.com> Date: Sun, 28 Jul 2019 10:26:20 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8DIndexFunc=E5=87=BD=E6=95=B0?= =?UTF-8?q?=E7=AD=BE=E5=90=8D=E9=94=99=E8=AF=AF=20(#698)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- eBook/06.7.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eBook/06.7.md b/eBook/06.7.md index 6157848..1be6e40 100644 --- a/eBook/06.7.md +++ b/eBook/06.7.md @@ -28,7 +28,7 @@ func callback(y int, f func(int, int)) { 将函数作为参数的最好的例子是函数 `strings.IndexFunc()`: -该函数的签名是 `func IndexFunc(s string, f func(c int) bool) int`,它的返回值是在函数 `f(c)` 返回 true、-1 或从未返回时的索引值。 +该函数的签名是 `func IndexFunc(s string, f func(c rune) bool) int`,它的返回值是在函数 `f(c)` 返回 true、-1 或从未返回时的索引值。 例如 `strings.IndexFunc(line, unicode.IsSpace)` 就会返回 `line` 中第一个空白字符的索引值。当然,您也可以书写自己的函数: