This commit is contained in:
leo
2016-03-24 22:56:39 +08:00
parent ec1cbb1dc0
commit 79e3478bce

View File

@@ -21,11 +21,11 @@ func nextFew1(n nexter, num int) []byte {
return b return b
} }
func nextFew2(n *nexter, num int) []byte { func nextFew2(n *nexter, num int) []byte {
var b []byte var b []byte
for i:=0; i < num; i++ { for i:=0; i < num; i++ {
b[i] = n.next() // 编译错误:n.next未定义*nexter类型没有next成员或next方法 b[i] = n.next() // 编译错误:n.next未定义*nexter类型没有next成员或next方法
} }
return b return b
} }
func main() { func main() {
fmt.Println(Hello World!) fmt.Println(Hello World!)