Skip to content

Commit

Permalink
lecture9
Browse files Browse the repository at this point in the history
  • Loading branch information
unknwon committed Apr 18, 2013
1 parent d9a1e44 commit bffff6d
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
- 第7课:[切片slice](lecture7/lecture7.md)[土豆网](http://www.tudou.com/programs/view/I-hrdoouUjs/) [优才网](http://www.ucai.cn/course/chapter/69/3210/4625)
- 第8课:[map](lecture8/lecture8.md)[土豆网](http://www.tudou.com/programs/view/4RPY1QgwvLg/) [优才网](http://www.ucai.cn/course/chapter/69/3210/4626)
- 第9课:[函数function](lecture9/lecture9.md)[预计2013年4月21日发布]
- 第10课:[结构Struct](lecture10/lecture10.md)[预计2013年4月25日发布]
- 第10课:[结构struct](lecture10/lecture10.md)[预计2013年4月25日发布]
- 第11课:[方法method](lecture11/lecture11.md)[预计2013年4月30日发布]
- 第12课:[接口interface](lecture12/lecture12.md)[预计2013年5月5日发布]
- 第13课:[并发concurrency](lecture13/lecture13.md)[预计2013年5月12日发布]
Expand Down
23 changes: 23 additions & 0 deletions lecture10/lecture10.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
第10课:结构struct(规划中)
==========================

###基本信息
- 课程时长:00:00
- 在线观看:[土豆网] [优才网]

###课程大纲
[00:00] 知识回顾
[00:00] 自定义类型
[00:00] 课堂作业布置

###作业答案
- 下堂课讲解

###补充说明
暂无说明

###相关链接
暂无链接

###课程链接
- [第9课:函数function](../lecture9/lecture9.md)
3 changes: 2 additions & 1 deletion lecture8/lecture8.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,5 @@
暂无链接

###课程链接
- [第7课:切片slice](../lecture7/lecture7.md)
- [第7课:切片slice](../lecture7/lecture7.md)
- [第9课:函数function](../lecture9/lecture9.md)
19 changes: 19 additions & 0 deletions lecture9/closure.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package main

import (
"fmt"
)

func main() {
var fs = [4]func(){}

for i := 0; i < 4; i++ {
defer fmt.Println("defer i = ", i)
defer func() { fmt.Println("defer_closure i = ", i) }()
fs[i] = func() { fmt.Println("closure i = ", i) }
}

for _, f := range fs {
f()
}
}
9 changes: 7 additions & 2 deletions lecture9/lecture9.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
第9课:函数function(规划中
第9课:函数function(备课中
==========================

###基本信息
Expand All @@ -7,7 +7,12 @@

###课程大纲
[00:00] 知识回顾
[00:00] 自定义类型
[00:00] 函数概述
[00:00] 函数的定义与使用
[00:00] 多返回值与命名返回值
[00:00] 不定长变参
[00:00] 匿名函数与闭包
[00:00] defer用法
[00:00] 课堂作业布置

###作业答案
Expand Down

0 comments on commit bffff6d

Please sign in to comment.