Move images (#704)

* refactor: merge image directories into one

```bash
git mv -v images/* eBook/images/
sed -i -e 's;../images;images;g' eBook/*.md
```

* use correct chapter number for image names in 4.9

* use correct chapter number for image names in 7.2.4
This commit is contained in:
marjune
2019-08-04 15:22:43 +08:00
committed by ᴊ. ᴄʜᴇɴ
parent 865fb2d64e
commit 6ed73bf4f5
34 changed files with 21 additions and 21 deletions

View File

@@ -4,7 +4,7 @@ Go 语言起源 2007 年,并于 2009 年正式对外发布。它从 2009 年 9
**这是一个由计算机领域 “发明之父” 所组成的黄金团队,他们对系统编程语言,操作系统和并行都有着非常深刻的见解** **这是一个由计算机领域 “发明之父” 所组成的黄金团队,他们对系统编程语言,操作系统和并行都有着非常深刻的见解**
![](../images/1.1.designers_of_Go.jpg?raw=true) ![](images/1.1.designers_of_Go.jpg?raw=true)
图 1.1 Go 语言设计者Griesemer、Thompson 和 Pike 图 1.1 Go 语言设计者Griesemer、Thompson 和 Pike
@@ -34,7 +34,7 @@ Go 语言的官方网站是 [golang.org](http://golang.org),这个站点采用
Go 通过以下的 Logo 来展示它的速度并以囊地鼠Gopher作为它的吉祥物。 Go 通过以下的 Logo 来展示它的速度并以囊地鼠Gopher作为它的吉祥物。
![](../images/1.2.Go_logo.jpg?raw=true) ![](images/1.2.Go_logo.jpg?raw=true)
图1.2 Go 语言 Logo 图1.2 Go 语言 Logo

View File

@@ -12,7 +12,7 @@
下图展示了一些其它编程语言对 Go 语言的影响: 下图展示了一些其它编程语言对 Go 语言的影响:
![](../images/1.3.influences_on_go.jpg?raw=true) ![](images/1.3.influences_on_go.jpg?raw=true)
图 1.3 其它编程语言对 Go 语言的影响 图 1.3 其它编程语言对 Go 语言的影响

View File

@@ -26,7 +26,7 @@ Go 语言开发团队开发了适用于以下操作系统的编译器:
编译器目前支持以下基于 Intel 或 AMD 处理器架构的程序构建。 编译器目前支持以下基于 Intel 或 AMD 处理器架构的程序构建。
![](../images/2.1.gc.jpg?raw=true) ![](images/2.1.gc.jpg?raw=true)
图2.1 gc 编译器支持的处理器架构 图2.1 gc 编译器支持的处理器架构

View File

@@ -47,7 +47,7 @@
在完成编译之后(通常在 1 分钟以内,如果你在 B 型树莓派上编译,一般需要 1 个小时),你会在终端看到如下信息被打印: 在完成编译之后(通常在 1 分钟以内,如果你在 B 型树莓派上编译,一般需要 1 个小时),你会在终端看到如下信息被打印:
![](../images/2.3.allbash.png?raw=true) ![](images/2.3.allbash.png?raw=true)
图 2.3 完成编译后在终端打印的信息 图 2.3 完成编译后在终端打印的信息

View File

@@ -29,7 +29,7 @@ LiteIDE 是一款非常好用的轻量级 Go 集成开发环境(基于 QT、Ka
同时,它具备了抽象语法树视图的功能,可以清楚地纵览项目中的常量、变量、函数、不同类型以及他们的属性和方法。 同时,它具备了抽象语法树视图的功能,可以清楚地纵览项目中的常量、变量、函数、不同类型以及他们的属性和方法。
![](../images/3.2.liteide.jpg?raw=true) ![](images/3.2.liteide.jpg?raw=true)
图 3.1 LiteIDE 代码编辑界面和抽象语法树视图 图 3.1 LiteIDE 代码编辑界面和抽象语法树视图
@@ -39,7 +39,7 @@ LiteIDE 是一款非常好用的轻量级 Go 集成开发环境(基于 QT、Ka
其依附于著名的 Eclipse 这个大型开发环境,虽然需要安装 JVM 运行环境,但却可以很容易地享有 Eclipse 本身所具有的诸多功能。这是一个非常好的编辑器,完善的代码补全、抽象语法树视图、项目管理和程序调试功能。 其依附于著名的 Eclipse 这个大型开发环境,虽然需要安装 JVM 运行环境,但却可以很容易地享有 Eclipse 本身所具有的诸多功能。这是一个非常好的编辑器,完善的代码补全、抽象语法树视图、项目管理和程序调试功能。
![](../images/3.2.goclipse.jpg?raw=true) ![](images/3.2.goclipse.jpg?raw=true)
图 3.2 GoClipse 代码编辑界面、抽象语法树视图和项目管理 图 3.2 GoClipse 代码编辑界面、抽象语法树视图和项目管理

View File

@@ -144,13 +144,13 @@ func main() {
所有像 int、float、bool 和 string 这些基本类型都属于值类型,使用这些类型的变量直接指向存在内存中的值: 所有像 int、float、bool 和 string 这些基本类型都属于值类型,使用这些类型的变量直接指向存在内存中的值:
![](../images/4.4.2_fig4.1.jpg?raw=true) ![](images/4.4.2_fig4.1.jpg?raw=true)
另外,像数组(第 7 章)和结构(第 10 章)这些复合类型也是值类型。 另外,像数组(第 7 章)和结构(第 10 章)这些复合类型也是值类型。
当使用等号 `=` 将一个变量的值赋值给另一个变量时,如:`j = i`,实际上是在内存中将 i 的值进行了拷贝: 当使用等号 `=` 将一个变量的值赋值给另一个变量时,如:`j = i`,实际上是在内存中将 i 的值进行了拷贝:
![](../images/4.4.2_fig4.2.jpg?raw=true) ![](images/4.4.2_fig4.2.jpg?raw=true)
你可以通过 &i 来获取变量 i 的内存地址(第 4.9 节例如0xf840000040每次的地址都可能不一样。值类型的变量的值存储在栈中。 你可以通过 &i 来获取变量 i 的内存地址(第 4.9 节例如0xf840000040每次的地址都可能不一样。值类型的变量的值存储在栈中。
@@ -160,7 +160,7 @@ func main() {
一个引用类型的变量 r1 存储的是 r1 的值所在的内存地址(数字),或内存地址中第一个字所在的位置。 一个引用类型的变量 r1 存储的是 r1 的值所在的内存地址(数字),或内存地址中第一个字所在的位置。
![](../images/4.4.2_fig4.3.jpg?raw=true) ![](images/4.4.2_fig4.3.jpg?raw=true)
这个内存地址被称之为指针(你可以从上图中很清晰地看到,第 4.9 节将会详细说明),这个指针实际上也被存在另外的某一个字中。 这个内存地址被称之为指针(你可以从上图中很清晰地看到,第 4.9 节将会详细说明),这个指针实际上也被存在另外的某一个字中。

View File

@@ -64,7 +64,7 @@ func main() {
我们可以用下图来表示内存使用的情况: 我们可以用下图来表示内存使用的情况:
![](../images/4.4.9_fig4.4.png?raw=true) ![](images/4.9_fig4.4.png?raw=true)
程序 string_pointer.go 为我们展示了指针对string的例子。 程序 string_pointer.go 为我们展示了指针对string的例子。
@@ -95,7 +95,7 @@ func main() {
内存示意图如下: 内存示意图如下:
![](../images/4.4.9_fig4.5.png?raw=true) ![](images/4.9_fig4.5.png?raw=true)
**注意事项** **注意事项**

View File

@@ -19,7 +19,7 @@ var identifier [len]type
var arr1 [5]int var arr1 [5]int
``` ```
在内存中的结构是:![](../images/7.1_fig7.1.png?raw=true) 在内存中的结构是:![](images/7.1_fig7.1.png?raw=true)
每个元素是一个整型值,当声明数组时所有的元素都会被自动初始化为默认值 0。 每个元素是一个整型值,当声明数组时所有的元素都会被自动初始化为默认值 0。

View File

@@ -48,7 +48,7 @@
- `y[0] = 3``y[1] = 5` - `y[0] = 3``y[1] = 5`
- 切片 `y[0:4]` 由 元素 357 和 11 组成。 - 切片 `y[0:4]` 由 元素 357 和 11 组成。
![](../images/7.2_fig7.2.png?raw=true) ![](images/7.2_fig7.2.png?raw=true)
示例 7.7 [array_slices.go](examples/chapter_7/array_slices.go) 示例 7.7 [array_slices.go](examples/chapter_7/array_slices.go)
@@ -148,7 +148,7 @@ make([]int, 50, 100)
new([100]int)[0:50] new([100]int)[0:50]
``` ```
下图描述了使用 make 方法生成的切片的内存结构:![](../images/7.2_fig7.2.1.png?raw=true) 下图描述了使用 make 方法生成的切片的内存结构:![](images/7.2_fig7.2.1.png?raw=true)
示例 7.8 [make_slice.go](examples/chapter_7/make_slice.go) 示例 7.8 [make_slice.go](examples/chapter_7/make_slice.go)
@@ -201,7 +201,7 @@ func main() {
换言之new 函数分配内存make 函数初始化;下图给出了区别: 换言之new 函数分配内存make 函数初始化;下图给出了区别:
![](../images/7.3_fig7.3.png?raw=true) ![](images/7.2_fig7.3.png?raw=true)
在图 7.3 的第一幅图中: 在图 7.3 的第一幅图中:

View File

@@ -45,7 +45,7 @@ b = append(b, s...)
字符串 `string s = "hello"` 和子字符串 `t = s[2:3]` 在内存中的结构可以用下图表示: 字符串 `string s = "hello"` 和子字符串 `t = s[2:3]` 在内存中的结构可以用下图表示:
![](../images/7.6_fig7.4.png) ![](images/7.6_fig7.4.png)
## 7.6.4 修改字符串中的某个字符 ## 7.6.4 修改字符串中的某个字符

View File

@@ -10,7 +10,7 @@
通道服务于通信的两个目的:值的交换,同步的,保证了两个计算(协程)任何时候都是可知状态。 通道服务于通信的两个目的:值的交换,同步的,保证了两个计算(协程)任何时候都是可知状态。
![](../images/14.2_fig14.1.png?raw=true) ![](images/14.2_fig14.1.png?raw=true)
通常使用这样的格式来声明通道:`var identifier chan datatype` 通常使用这样的格式来声明通道:`var identifier chan datatype`
@@ -566,7 +566,7 @@ func processChannel(in <-chan int, out chan<- string) {
这里有一个来自 Go 指导的很赞的例子打印了输出的素数使用选择器作为它的算法每个 prime 都有一个选择器如下图 这里有一个来自 Go 指导的很赞的例子打印了输出的素数使用选择器作为它的算法每个 prime 都有一个选择器如下图
![](../images/14.2_fig14.2.png?raw=true) ![](images/14.2_fig14.2.png?raw=true)
版本1示例 14.7-[sieve1.go](examples/chapter_14/sieve1.go) 版本1示例 14.7-[sieve1.go](examples/chapter_14/sieve1.go)

View File

@@ -134,7 +134,7 @@ Received on channel 1: 94348
使用以下序列在协程中计算 pi开启一个协程来计算公式中的每一项并将结果放入通道`main()` 函数收集并累加结果,打印出 pi 的近似值。 使用以下序列在协程中计算 pi开启一个协程来计算公式中的每一项并将结果放入通道`main()` 函数收集并累加结果,打印出 pi 的近似值。
![](../images/14.4_piseries.png?raw=true) ![](images/14.4_piseries.png?raw=true)
计算执行时间(参见第 [6.11](6.11.md) 节) 计算执行时间(参见第 [6.11](6.11.md) 节)

View File

@@ -60,7 +60,7 @@ func main() {
编写一个网页程序,可以让用户输入一连串的数字,然后将它们打印出来,计算出这些数字的均值和中值,就像下边这张截图一样: 编写一个网页程序,可以让用户输入一连串的数字,然后将它们打印出来,计算出这些数字的均值和中值,就像下边这张截图一样:
![](../images/15.4_fig15.1.jpg?raw=true) ![](images/15.4_fig15.1.jpg?raw=true)
## 链接 ## 链接

View File

Before

Width:  |  Height:  |  Size: 44 KiB

After

Width:  |  Height:  |  Size: 44 KiB

View File

Before

Width:  |  Height:  |  Size: 24 KiB

After

Width:  |  Height:  |  Size: 24 KiB

View File

Before

Width:  |  Height:  |  Size: 94 KiB

After

Width:  |  Height:  |  Size: 94 KiB

View File

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

View File

Before

Width:  |  Height:  |  Size: 66 KiB

After

Width:  |  Height:  |  Size: 66 KiB

View File

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB

View File

Before

Width:  |  Height:  |  Size: 68 KiB

After

Width:  |  Height:  |  Size: 68 KiB

View File

Before

Width:  |  Height:  |  Size: 33 KiB

After

Width:  |  Height:  |  Size: 33 KiB

View File

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB

View File

Before

Width:  |  Height:  |  Size: 146 KiB

After

Width:  |  Height:  |  Size: 146 KiB

View File

Before

Width:  |  Height:  |  Size: 132 KiB

After

Width:  |  Height:  |  Size: 132 KiB

View File

Before

Width:  |  Height:  |  Size: 8.6 KiB

After

Width:  |  Height:  |  Size: 8.6 KiB

View File

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

View File

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 18 KiB

View File

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

View File

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

View File

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

View File

Before

Width:  |  Height:  |  Size: 70 KiB

After

Width:  |  Height:  |  Size: 70 KiB

View File

Before

Width:  |  Height:  |  Size: 122 KiB

After

Width:  |  Height:  |  Size: 122 KiB

View File

Before

Width:  |  Height:  |  Size: 83 KiB

After

Width:  |  Height:  |  Size: 83 KiB

View File

Before

Width:  |  Height:  |  Size: 132 KiB

After

Width:  |  Height:  |  Size: 132 KiB