摘要: func fib() func() int { var n1, n2 int return func() int { if n1 == 0 && n2 == 0 { n1 = 1 } else { n1, n2 = n2, n1 + n2 } return n2 } } next := fib() 阅读全文
posted @ 2023-02-20 21:21 roadwide 阅读(59) 评论(0) 推荐(0) 编辑
摘要: backticks When using backticks (`) to make strings(Raw string literals), backslashes (\) don't have any special meaning and don't mark the beginning o 阅读全文
posted @ 2023-02-20 17:06 roadwide 阅读(182) 评论(0) 推荐(0) 编辑
摘要: rune与string The rune type in Go is an alias for int32. Given this underlying int32 type, the rune type holds a signed 32-bit integer value. However, u 阅读全文
posted @ 2023-02-20 11:47 roadwide 阅读(50) 评论(0) 推荐(0) 编辑