forked from unknwon/go-fundamental-programming
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
52 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters