From 6ed73bf4f5259de40b087728de9e6551e9796d65 Mon Sep 17 00:00:00 2001 From: marjune Date: Sun, 4 Aug 2019 15:22:43 +0800 Subject: [PATCH] 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 --- eBook/01.1.md | 4 ++-- eBook/01.2.md | 2 +- eBook/02.1.md | 2 +- eBook/02.3.md | 2 +- eBook/03.2.md | 4 ++-- eBook/04.4.md | 6 +++--- eBook/04.9.md | 4 ++-- eBook/07.1.md | 2 +- eBook/07.2.md | 6 +++--- eBook/07.6.md | 2 +- eBook/14.2.md | 4 ++-- eBook/14.4.md | 2 +- eBook/15.4.md | 2 +- {images => eBook/images}/1.1.designers_of_Go.jpg | Bin {images => eBook/images}/1.2.Go_logo.jpg | Bin {images => eBook/images}/1.3.influences_on_go.jpg | Bin {images => eBook/images}/14.2_fig14.1.png | Bin {images => eBook/images}/14.2_fig14.2.png | Bin {images => eBook/images}/14.4_piseries.png | Bin {images => eBook/images}/15.4_fig15.1.jpg | Bin {images => eBook/images}/2.1.gc.jpg | Bin {images => eBook/images}/2.3.allbash.png | Bin {images => eBook/images}/3.2.goclipse.jpg | Bin {images => eBook/images}/3.2.liteide.jpg | Bin {images => eBook/images}/4.4.2_fig4.1.jpg | Bin {images => eBook/images}/4.4.2_fig4.2.jpg | Bin {images => eBook/images}/4.4.2_fig4.3.jpg | Bin .../4.4.9_fig4.4.png => eBook/images/4.9_fig4.4.png | Bin .../4.4.9_fig4.5.png => eBook/images/4.9_fig4.5.png | Bin {images => eBook/images}/7.1_fig7.1.png | Bin {images => eBook/images}/7.2_fig7.2.1.png | Bin {images => eBook/images}/7.2_fig7.2.png | Bin .../7.3_fig7.3.png => eBook/images/7.2_fig7.3.png | Bin {images => eBook/images}/7.6_fig7.4.png | Bin 34 files changed, 21 insertions(+), 21 deletions(-) rename {images => eBook/images}/1.1.designers_of_Go.jpg (100%) rename {images => eBook/images}/1.2.Go_logo.jpg (100%) rename {images => eBook/images}/1.3.influences_on_go.jpg (100%) rename {images => eBook/images}/14.2_fig14.1.png (100%) rename {images => eBook/images}/14.2_fig14.2.png (100%) rename {images => eBook/images}/14.4_piseries.png (100%) rename {images => eBook/images}/15.4_fig15.1.jpg (100%) rename {images => eBook/images}/2.1.gc.jpg (100%) rename {images => eBook/images}/2.3.allbash.png (100%) rename {images => eBook/images}/3.2.goclipse.jpg (100%) rename {images => eBook/images}/3.2.liteide.jpg (100%) rename {images => eBook/images}/4.4.2_fig4.1.jpg (100%) rename {images => eBook/images}/4.4.2_fig4.2.jpg (100%) rename {images => eBook/images}/4.4.2_fig4.3.jpg (100%) rename images/4.4.9_fig4.4.png => eBook/images/4.9_fig4.4.png (100%) rename images/4.4.9_fig4.5.png => eBook/images/4.9_fig4.5.png (100%) rename {images => eBook/images}/7.1_fig7.1.png (100%) rename {images => eBook/images}/7.2_fig7.2.1.png (100%) rename {images => eBook/images}/7.2_fig7.2.png (100%) rename images/7.3_fig7.3.png => eBook/images/7.2_fig7.3.png (100%) rename {images => eBook/images}/7.6_fig7.4.png (100%) diff --git a/eBook/01.1.md b/eBook/01.1.md index 345f647..fe62cfe 100644 --- a/eBook/01.1.md +++ b/eBook/01.1.md @@ -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 @@ -34,7 +34,7 @@ Go 语言的官方网站是 [golang.org](http://golang.org),这个站点采用 Go 通过以下的 Logo 来展示它的速度,并以囊地鼠(Gopher)作为它的吉祥物。 -![](../images/1.2.Go_logo.jpg?raw=true) +![](images/1.2.Go_logo.jpg?raw=true) 图1.2 Go 语言 Logo diff --git a/eBook/01.2.md b/eBook/01.2.md index b64e99a..934e740 100644 --- a/eBook/01.2.md +++ b/eBook/01.2.md @@ -12,7 +12,7 @@ 下图展示了一些其它编程语言对 Go 语言的影响: -![](../images/1.3.influences_on_go.jpg?raw=true) +![](images/1.3.influences_on_go.jpg?raw=true) 图 1.3 其它编程语言对 Go 语言的影响 diff --git a/eBook/02.1.md b/eBook/02.1.md index e6b1c6b..21bb874 100644 --- a/eBook/02.1.md +++ b/eBook/02.1.md @@ -26,7 +26,7 @@ Go 语言开发团队开发了适用于以下操作系统的编译器: 编译器目前支持以下基于 Intel 或 AMD 处理器架构的程序构建。 - ![](../images/2.1.gc.jpg?raw=true) + ![](images/2.1.gc.jpg?raw=true) 图2.1 gc 编译器支持的处理器架构 diff --git a/eBook/02.3.md b/eBook/02.3.md index 666ff29..cabaf15 100644 --- a/eBook/02.3.md +++ b/eBook/02.3.md @@ -47,7 +47,7 @@ 在完成编译之后(通常在 1 分钟以内,如果你在 B 型树莓派上编译,一般需要 1 个小时),你会在终端看到如下信息被打印: - ![](../images/2.3.allbash.png?raw=true) + ![](images/2.3.allbash.png?raw=true) 图 2.3 完成编译后在终端打印的信息 diff --git a/eBook/03.2.md b/eBook/03.2.md index 97159de..3012d10 100644 --- a/eBook/03.2.md +++ b/eBook/03.2.md @@ -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 代码编辑界面和抽象语法树视图 @@ -39,7 +39,7 @@ LiteIDE 是一款非常好用的轻量级 Go 集成开发环境(基于 QT、Ka 其依附于著名的 Eclipse 这个大型开发环境,虽然需要安装 JVM 运行环境,但却可以很容易地享有 Eclipse 本身所具有的诸多功能。这是一个非常好的编辑器,完善的代码补全、抽象语法树视图、项目管理和程序调试功能。 -![](../images/3.2.goclipse.jpg?raw=true) +![](images/3.2.goclipse.jpg?raw=true) 图 3.2 GoClipse 代码编辑界面、抽象语法树视图和项目管理 diff --git a/eBook/04.4.md b/eBook/04.4.md index 7b73461..39136da 100644 --- a/eBook/04.4.md +++ b/eBook/04.4.md @@ -144,13 +144,13 @@ func main() { 所有像 int、float、bool 和 string 这些基本类型都属于值类型,使用这些类型的变量直接指向存在内存中的值: -![](../images/4.4.2_fig4.1.jpg?raw=true) +![](images/4.4.2_fig4.1.jpg?raw=true) 另外,像数组(第 7 章)和结构(第 10 章)这些复合类型也是值类型。 当使用等号 `=` 将一个变量的值赋值给另一个变量时,如:`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(每次的地址都可能不一样)。值类型的变量的值存储在栈中。 @@ -160,7 +160,7 @@ func main() { 一个引用类型的变量 r1 存储的是 r1 的值所在的内存地址(数字),或内存地址中第一个字所在的位置。 -![](../images/4.4.2_fig4.3.jpg?raw=true) +![](images/4.4.2_fig4.3.jpg?raw=true) 这个内存地址被称之为指针(你可以从上图中很清晰地看到,第 4.9 节将会详细说明),这个指针实际上也被存在另外的某一个字中。 diff --git a/eBook/04.9.md b/eBook/04.9.md index 4656aa6..aa035a2 100644 --- a/eBook/04.9.md +++ b/eBook/04.9.md @@ -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的例子。 @@ -95,7 +95,7 @@ func main() { 内存示意图如下: -![](../images/4.4.9_fig4.5.png?raw=true) +![](images/4.9_fig4.5.png?raw=true) **注意事项** diff --git a/eBook/07.1.md b/eBook/07.1.md index b1f310d..16aa87a 100644 --- a/eBook/07.1.md +++ b/eBook/07.1.md @@ -19,7 +19,7 @@ var identifier [len]type var arr1 [5]int ``` -在内存中的结构是:![](../images/7.1_fig7.1.png?raw=true) +在内存中的结构是:![](images/7.1_fig7.1.png?raw=true) 每个元素是一个整型值,当声明数组时所有的元素都会被自动初始化为默认值 0。 diff --git a/eBook/07.2.md b/eBook/07.2.md index 48f4ab8..4f9e383 100644 --- a/eBook/07.2.md +++ b/eBook/07.2.md @@ -48,7 +48,7 @@ - `y[0] = 3` 且 `y[1] = 5`。 - 切片 `y[0:4]` 由 元素 3,5,7 和 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) @@ -148,7 +148,7 @@ make([]int, 50, 100) 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) @@ -201,7 +201,7 @@ func main() { 换言之,new 函数分配内存,make 函数初始化;下图给出了区别: -![](../images/7.3_fig7.3.png?raw=true) +![](images/7.2_fig7.3.png?raw=true) 在图 7.3 的第一幅图中: diff --git a/eBook/07.6.md b/eBook/07.6.md index 5b74c4d..2151b83 100644 --- a/eBook/07.6.md +++ b/eBook/07.6.md @@ -45,7 +45,7 @@ b = append(b, s...) 字符串 `string s = "hello"` 和子字符串 `t = s[2:3]` 在内存中的结构可以用下图表示: -![](../images/7.6_fig7.4.png) +![](images/7.6_fig7.4.png) ## 7.6.4 修改字符串中的某个字符 diff --git a/eBook/14.2.md b/eBook/14.2.md index 747c508..943d440 100644 --- a/eBook/14.2.md +++ b/eBook/14.2.md @@ -10,7 +10,7 @@ 通道服务于通信的两个目的:值的交换,同步的,保证了两个计算(协程)任何时候都是可知状态。 -![](../images/14.2_fig14.1.png?raw=true) +![](images/14.2_fig14.1.png?raw=true) 通常使用这样的格式来声明通道:`var identifier chan datatype` @@ -566,7 +566,7 @@ func processChannel(in <-chan int, out chan<- string) { 这里有一个来自 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) diff --git a/eBook/14.4.md b/eBook/14.4.md index 63485dd..e03a84e 100644 --- a/eBook/14.4.md +++ b/eBook/14.4.md @@ -134,7 +134,7 @@ Received on channel 1: 94348 使用以下序列在协程中计算 pi:开启一个协程来计算公式中的每一项并将结果放入通道,`main()` 函数收集并累加结果,打印出 pi 的近似值。 -![](../images/14.4_piseries.png?raw=true) +![](images/14.4_piseries.png?raw=true) 计算执行时间(参见第 [6.11](6.11.md) 节) diff --git a/eBook/15.4.md b/eBook/15.4.md index fedd5b5..34a2df1 100644 --- a/eBook/15.4.md +++ b/eBook/15.4.md @@ -60,7 +60,7 @@ func main() { 编写一个网页程序,可以让用户输入一连串的数字,然后将它们打印出来,计算出这些数字的均值和中值,就像下边这张截图一样: -![](../images/15.4_fig15.1.jpg?raw=true) +![](images/15.4_fig15.1.jpg?raw=true) ## 链接 diff --git a/images/1.1.designers_of_Go.jpg b/eBook/images/1.1.designers_of_Go.jpg similarity index 100% rename from images/1.1.designers_of_Go.jpg rename to eBook/images/1.1.designers_of_Go.jpg diff --git a/images/1.2.Go_logo.jpg b/eBook/images/1.2.Go_logo.jpg similarity index 100% rename from images/1.2.Go_logo.jpg rename to eBook/images/1.2.Go_logo.jpg diff --git a/images/1.3.influences_on_go.jpg b/eBook/images/1.3.influences_on_go.jpg similarity index 100% rename from images/1.3.influences_on_go.jpg rename to eBook/images/1.3.influences_on_go.jpg diff --git a/images/14.2_fig14.1.png b/eBook/images/14.2_fig14.1.png similarity index 100% rename from images/14.2_fig14.1.png rename to eBook/images/14.2_fig14.1.png diff --git a/images/14.2_fig14.2.png b/eBook/images/14.2_fig14.2.png similarity index 100% rename from images/14.2_fig14.2.png rename to eBook/images/14.2_fig14.2.png diff --git a/images/14.4_piseries.png b/eBook/images/14.4_piseries.png similarity index 100% rename from images/14.4_piseries.png rename to eBook/images/14.4_piseries.png diff --git a/images/15.4_fig15.1.jpg b/eBook/images/15.4_fig15.1.jpg similarity index 100% rename from images/15.4_fig15.1.jpg rename to eBook/images/15.4_fig15.1.jpg diff --git a/images/2.1.gc.jpg b/eBook/images/2.1.gc.jpg similarity index 100% rename from images/2.1.gc.jpg rename to eBook/images/2.1.gc.jpg diff --git a/images/2.3.allbash.png b/eBook/images/2.3.allbash.png similarity index 100% rename from images/2.3.allbash.png rename to eBook/images/2.3.allbash.png diff --git a/images/3.2.goclipse.jpg b/eBook/images/3.2.goclipse.jpg similarity index 100% rename from images/3.2.goclipse.jpg rename to eBook/images/3.2.goclipse.jpg diff --git a/images/3.2.liteide.jpg b/eBook/images/3.2.liteide.jpg similarity index 100% rename from images/3.2.liteide.jpg rename to eBook/images/3.2.liteide.jpg diff --git a/images/4.4.2_fig4.1.jpg b/eBook/images/4.4.2_fig4.1.jpg similarity index 100% rename from images/4.4.2_fig4.1.jpg rename to eBook/images/4.4.2_fig4.1.jpg diff --git a/images/4.4.2_fig4.2.jpg b/eBook/images/4.4.2_fig4.2.jpg similarity index 100% rename from images/4.4.2_fig4.2.jpg rename to eBook/images/4.4.2_fig4.2.jpg diff --git a/images/4.4.2_fig4.3.jpg b/eBook/images/4.4.2_fig4.3.jpg similarity index 100% rename from images/4.4.2_fig4.3.jpg rename to eBook/images/4.4.2_fig4.3.jpg diff --git a/images/4.4.9_fig4.4.png b/eBook/images/4.9_fig4.4.png similarity index 100% rename from images/4.4.9_fig4.4.png rename to eBook/images/4.9_fig4.4.png diff --git a/images/4.4.9_fig4.5.png b/eBook/images/4.9_fig4.5.png similarity index 100% rename from images/4.4.9_fig4.5.png rename to eBook/images/4.9_fig4.5.png diff --git a/images/7.1_fig7.1.png b/eBook/images/7.1_fig7.1.png similarity index 100% rename from images/7.1_fig7.1.png rename to eBook/images/7.1_fig7.1.png diff --git a/images/7.2_fig7.2.1.png b/eBook/images/7.2_fig7.2.1.png similarity index 100% rename from images/7.2_fig7.2.1.png rename to eBook/images/7.2_fig7.2.1.png diff --git a/images/7.2_fig7.2.png b/eBook/images/7.2_fig7.2.png similarity index 100% rename from images/7.2_fig7.2.png rename to eBook/images/7.2_fig7.2.png diff --git a/images/7.3_fig7.3.png b/eBook/images/7.2_fig7.3.png similarity index 100% rename from images/7.3_fig7.3.png rename to eBook/images/7.2_fig7.3.png diff --git a/images/7.6_fig7.4.png b/eBook/images/7.6_fig7.4.png similarity index 100% rename from images/7.6_fig7.4.png rename to eBook/images/7.6_fig7.4.png