gopl-zh.github.com/preface.html

295 lines
44 KiB
HTML
Raw Normal View History

<!DOCTYPE HTML>
<html lang="zh" class="sidebar-visible no-js light">
<head>
<!-- Book generated using mdBook -->
<meta charset="UTF-8">
<title>前言 - Go语言圣经</title>
<!-- Custom HTML head -->
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
<meta name="description" content="&lt;The Go Programming Language&gt;中文版">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="theme-color" content="#ffffff" />
<link rel="icon" href="favicon.svg">
<link rel="shortcut icon" href="favicon.png">
<link rel="stylesheet" href="css/variables.css">
<link rel="stylesheet" href="css/general.css">
<link rel="stylesheet" href="css/chrome.css">
<link rel="stylesheet" href="css/print.css" media="print">
<!-- Fonts -->
<link rel="stylesheet" href="FontAwesome/css/font-awesome.css">
<link rel="stylesheet" href="fonts/fonts.css">
<!-- Highlight.js Stylesheets -->
<link rel="stylesheet" href="highlight.css">
<link rel="stylesheet" href="tomorrow-night.css">
<link rel="stylesheet" href="ayu-highlight.css">
<!-- Custom theme stylesheets -->
<link rel="stylesheet" href="style.css">
</head>
<body>
<!-- Provide site root to javascript -->
<script type="text/javascript">
var path_to_root = "";
var default_theme = window.matchMedia("(prefers-color-scheme: dark)").matches ? "navy" : "light";
</script>
<!-- Work around some values being stored in localStorage wrapped in quotes -->
<script type="text/javascript">
try {
var theme = localStorage.getItem('mdbook-theme');
var sidebar = localStorage.getItem('mdbook-sidebar');
if (theme.startsWith('"') && theme.endsWith('"')) {
localStorage.setItem('mdbook-theme', theme.slice(1, theme.length - 1));
}
if (sidebar.startsWith('"') && sidebar.endsWith('"')) {
localStorage.setItem('mdbook-sidebar', sidebar.slice(1, sidebar.length - 1));
}
} catch (e) { }
</script>
<!-- Set the theme before any content is loaded, prevents flash -->
<script type="text/javascript">
var theme;
try { theme = localStorage.getItem('mdbook-theme'); } catch(e) { }
if (theme === null || theme === undefined) { theme = default_theme; }
var html = document.querySelector('html');
html.classList.remove('no-js')
html.classList.remove('light')
html.classList.add(theme);
html.classList.add('js');
</script>
<!-- Hide / unhide sidebar before it is displayed -->
<script type="text/javascript">
var html = document.querySelector('html');
var sidebar = 'hidden';
if (document.body.clientWidth >= 1080) {
try { sidebar = localStorage.getItem('mdbook-sidebar'); } catch(e) { }
sidebar = sidebar || 'visible';
}
html.classList.remove('sidebar-visible');
html.classList.add("sidebar-" + sidebar);
</script>
<nav id="sidebar" class="sidebar" aria-label="Table of contents">
<div class="sidebar-scrollbox">
<ol class="chapter"><li class="chapter-item expanded affix "><a href="index.html">Go语言圣经</a></li><li class="chapter-item expanded affix "><a href="preface-zh.html">译者序</a></li><li class="chapter-item expanded affix "><a href="preface.html" class="active">前言</a></li><li class="chapter-item expanded "><a href="ch1/ch1.html"><strong aria-hidden="true">1.</strong> 入门</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="ch1/ch1-01.html"><strong aria-hidden="true">1.1.</strong> Hello, World</a></li><li class="chapter-item expanded "><a href="ch1/ch1-02.html"><strong aria-hidden="true">1.2.</strong> 命令行参数</a></li><li class="chapter-item expanded "><a href="ch1/ch1-03.html"><strong aria-hidden="true">1.3.</strong> 查找重复的行</a></li><li class="chapter-item expanded "><a href="ch1/ch1-04.html"><strong aria-hidden="true">1.4.</strong> GIF动画</a></li><li class="chapter-item expanded "><a href="ch1/ch1-05.html"><strong aria-hidden="true">1.5.</strong> 获取URL</a></li><li class="chapter-item expanded "><a href="ch1/ch1-06.html"><strong aria-hidden="true">1.6.</strong> 并发获取多个URL</a></li><li class="chapter-item expanded "><a href="ch1/ch1-07.html"><strong aria-hidden="true">1.7.</strong> Web服务</a></li><li class="chapter-item expanded "><a href="ch1/ch1-08.html"><strong aria-hidden="true">1.8.</strong> 本章要点</a></li></ol></li><li class="chapter-item expanded "><a href="ch2/ch2.html"><strong aria-hidden="true">2.</strong> 程序结构</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="ch2/ch2-01.html"><strong aria-hidden="true">2.1.</strong> 命名</a></li><li class="chapter-item expanded "><a href="ch2/ch2-02.html"><strong aria-hidden="true">2.2.</strong> 声明</a></li><li class="chapter-item expanded "><a href="ch2/ch2-03.html"><strong aria-hidden="true">2.3.</strong> 变量</a></li><li class="chapter-item expanded "><a href="ch2/ch2-04.html"><strong aria-hidden="true">2.4.</strong> 赋值</a></li><li class="chapter-item expanded "><a href="ch2/ch2-05.html"><strong aria-hidden="true">2.5.</strong> 类型</a></li><li class="chapter-item expanded "><a href="ch2/ch2-06.html"><strong aria-hidden="true">2.6.</strong> 包和文件</a></li><li class="chapter-item expanded "><a href="ch2/ch2-07.html"><strong aria-hidden="true">2.7.</strong> 作用域</a></li></ol></li><li class="chapter-item expanded "><a href="ch3/ch3.html"><strong aria-hidden="true">3.</strong> 基础数据类型</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="ch3/ch3-01.html"><strong aria-hidden="true">3.1.</strong> 整型</a></li><li class="chapter-item expanded "><a href="ch3/ch3-02.html"><strong aria-hidden="true">3.2.</strong> 浮点数</a></li><li class="chapter-item expanded "><a href="ch3/ch3-03.html"><strong aria-hidden="true">3.3.</strong> 复数</a></li><li class="chapter-item expanded "><a href="ch3/ch3-04.html"><strong aria-hidden="true">3.4.</strong> 布尔型</a></li><li class="chapter-item expanded "><a href="ch3/ch3-05.html"><strong aria-hidden="true">3.5.</strong> 字符串</a></li><li class="chapter-item expanded "><a href="ch3/ch3-06.html"><strong aria-hidden="true">3.6.</strong> 常量</a></li></ol></li><li class="chapter-item expanded "><a href="ch4/ch4.html"><strong aria-hidden="true">4.</strong> 复合数据类型</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="ch4/ch4-01.html"><strong aria-hidden="true">4.1.</strong> 数组</a></li><li class="chapter-item expanded "><a href="ch4/ch4-02.html"><strong aria-hidden="true">4.2.</strong> Slice</a></li><li class="chapter-item expanded "><a href="ch4/ch4-03.html"><strong aria-hidden="true">4.3.</strong> Map</a></li><li class="chapter-item expanded "><a href="ch4/ch4-04.html"><strong aria-hidden="true">4.4.</strong> 结构体</a></li><li class="chapter-item expanded "><a href="ch4/ch4-05.html"><strong aria-hidden="true">4.5.</strong> JSON</a></li><li class="chapter-item expanded "><a href="ch4/ch4-06.html"><strong aria-hid
<div id="sidebar-resize-handle" class="sidebar-resize-handle"></div>
</nav>
<div id="page-wrapper" class="page-wrapper">
<div class="page">
<div id="menu-bar-hover-placeholder"></div>
<div id="menu-bar" class="menu-bar sticky bordered">
<div class="left-buttons">
<button id="sidebar-toggle" class="icon-button" type="button" title="Toggle Table of Contents" aria-label="Toggle Table of Contents" aria-controls="sidebar">
<i class="fa fa-bars"></i>
</button>
<button id="theme-toggle" class="icon-button" type="button" title="Change theme" aria-label="Change theme" aria-haspopup="true" aria-expanded="false" aria-controls="theme-list">
<i class="fa fa-paint-brush"></i>
</button>
<ul id="theme-list" class="theme-popup" aria-label="Themes" role="menu">
<li role="none"><button role="menuitem" class="theme" id="light">Light (default)</button></li>
<li role="none"><button role="menuitem" class="theme" id="rust">Rust</button></li>
<li role="none"><button role="menuitem" class="theme" id="coal">Coal</button></li>
<li role="none"><button role="menuitem" class="theme" id="navy">Navy</button></li>
<li role="none"><button role="menuitem" class="theme" id="ayu">Ayu</button></li>
</ul>
<button id="search-toggle" class="icon-button" type="button" title="Search. (Shortkey: s)" aria-label="Toggle Searchbar" aria-expanded="false" aria-keyshortcuts="S" aria-controls="searchbar">
<i class="fa fa-search"></i>
</button>
</div>
<h1 class="menu-title">Go语言圣经</h1>
<div class="right-buttons">
<a href="print.html" title="Print this book" aria-label="Print this book">
<i id="print-button" class="fa fa-print"></i>
</a>
<a href="https://github.com/gopl-zh/gopl-zh.github.com" title="Git repository" aria-label="Git repository">
<i id="git-repository-button" class="fa fa-github"></i>
</a>
<a href="https://github.com/gopl-zh/gopl-zh.github.com/edit/master/./preface.md" title="Suggest an edit" aria-label="Suggest an edit">
<i id="git-edit-button" class="fa fa-edit"></i>
</a>
</div>
</div>
<div id="search-wrapper" class="hidden">
<form id="searchbar-outer" class="searchbar-outer">
<input type="search" id="searchbar" name="searchbar" placeholder="Search this book ..." aria-controls="searchresults-outer" aria-describedby="searchresults-header">
</form>
<div id="searchresults-outer" class="searchresults-outer hidden">
<div id="searchresults-header" class="searchresults-header"></div>
<ul id="searchresults">
</ul>
</div>
</div>
<!-- Apply ARIA attributes after the sidebar and the sidebar toggle button are added to the DOM -->
<script type="text/javascript">
document.getElementById('sidebar-toggle').setAttribute('aria-expanded', sidebar === 'visible');
document.getElementById('sidebar').setAttribute('aria-hidden', sidebar !== 'visible');
Array.from(document.querySelectorAll('#sidebar a')).forEach(function(link) {
link.setAttribute('tabIndex', sidebar === 'visible' ? 0 : -1);
});
</script>
<div id="content" class="content">
<!-- Page table of contents -->
<div class="sidetoc"><nav class="pagetoc"></nav></div>
<main>
<!-- 头部 -->
<ul dir="auto">
<li><em>KusonStack一站式可编程配置技术栈(Go): <a href="https://github.com/KusionStack/kusion">https://github.com/KusionStack/kusion</a></em></li>
<li><em>KCL 配置编程语言(Rust): <a href="https://github.com/KusionStack/KCLVM">https://github.com/KusionStack/KCLVM</a></em></li>
<li><em>凹语言™: <a href="https://github.com/wa-lang/wa">https://github.com/wa-lang/wa</a></em></li>
</ul>
<hr>
<h1 id="前言"><a class="header" href="#前言">前言</a></h1>
<h2 id="go语言起源"><a class="header" href="#go语言起源">Go语言起源</a></h2>
<p>编程语言的演化跟生物物种的演化类似,一个成功的编程语言的后代一般都会继承它们祖先的优点;当然有时多种语言杂合也可能会产生令人惊讶的特性;还有一些激进的新特性可能并没有先例。通过观察这些影响,我们可以学到为什么一门语言是这样子的,它已经适应了怎样的环境。</p>
<p>下图展示了有哪些早期的编程语言对Go语言的设计产生了重要影响。</p>
<p><img src="../images/ch0-01.png" alt="" /></p>
<p>Go语言有时候被描述为“类C语言”或者是“21世纪的C语言”。Go从C语言继承了相似的表达式语法、控制流结构、基础数据类型、调用参数传值、指针等很多思想还有C语言一直所看中的编译后机器码的运行效率以及和现有操作系统的无缝适配。</p>
<p>但是在Go语言的家族树中还有其它的祖先。其中一个有影响力的分支来自<a href="https://en.wikipedia.org/wiki/Niklaus_Wirth">Niklaus Wirth</a>所设计的<code>Pascal</code>语言。然后<code>Modula-2</code>语言激发了包的概念。然后<code>Oberon</code>语言摒弃了模块接口文件和模块实现文件之间的区别。第二代的<code>Oberon-2</code>语言直接影响了包的导入和声明的语法,还有<code>Oberon</code>语言的面向对象特性所提供的方法的声明语法等。</p>
<p>Go语言的另一支祖先带来了Go语言区别其他语言的重要特性灵感来自于贝尔实验室的<a href="https://en.wikipedia.org/wiki/Tony_Hoare">Tony Hoare</a>于1978年发表的鲜为外界所知的关于并发研究的基础文献 <em>顺序通信进程</em> <em>communicating sequential processes</em> ,缩写为<code>CSP</code>。在<code>CSP</code>中,程序是一组中间没有共享状态的平行运行的处理过程,它们之间使用管道进行通信和控制同步。不过<a href="https://en.wikipedia.org/wiki/Tony_Hoare">Tony Hoare</a><code>CSP</code>只是一个用于描述并发性基本概念的描述语言,并不是一个可以编写可执行程序的通用编程语言。</p>
<p>接下来Rob Pike和其他人开始不断尝试将<a href="https://en.wikipedia.org/wiki/Communicating_sequential_processes">CSP</a>引入实际的编程语言中。他们第一次尝试引入<a href="https://en.wikipedia.org/wiki/Communicating_sequential_processes">CSP</a>特性的编程语言叫<a href="http://doc.cat-v.org/bell_labs/squeak/">Squeak</a>(老鼠间交流的语言),是一个提供鼠标和键盘事件处理的编程语言,它的管道是静态创建的。然后是改进版的<a href="http://doc.cat-v.org/bell_labs/squeak/">Newsqueak</a>语言,提供了类似<code>C</code>语言语句和表达式的语法和类似<code>Pascal</code>语言的推导语法。<code>Newsqueak</code>是一个带垃圾回收的纯函数式语言,它再次针对键盘、鼠标和窗口事件管理。但是在<code>Newsqueak</code>语言中管道是动态创建的,属于第一类值,可以保存到变量中。</p>
<p><code>Plan9</code>操作系统中,这些优秀的想法被吸收到了一个叫<code>Alef</code>的编程语言中。<code>Alef</code>试图将<code>Newsqueak</code>语言改造为系统编程语言,但是因为缺少垃圾回收机制而导致并发编程很痛苦。(译注:在<code>Alef</code>之后还有一个叫<code>Limbo</code>的编程语言Go语言从其中借鉴了很多特性。 具体请参考Pike的讲稿http://talks.golang.org/2012/concurrency.slide#9 </p>
<p>Go语言的其他的一些特性零散地来自于其他一些编程语言比如<code>iota</code>语法是从<code>APL</code>语言借鉴,词法作用域与嵌套函数来自于<code>Scheme</code>语言和其他很多语言。当然我们也可以从Go中发现很多创新的设计。比如Go语言的切片为动态数组提供了有效的随机存取的性能这可能会让人联想到链表的底层的共享机制。还有Go语言新发明的<code>defer</code>语句。</p>
<h2 id="go语言项目"><a class="header" href="#go语言项目">Go语言项目</a></h2>
<p>所有的编程语言都反映了语言设计者对编程哲学的反思通常包括之前的语言所暴露的一些不足地方的改进。Go项目是在Google公司维护超级复杂的几个软件系统遇到的一些问题的反思但是这类问题绝不是Google公司所特有的</p>
<p>正如<a href="http://genius.cat-v.org/rob-pike/">Rob Pike</a>所说,“软件的复杂性是乘法级相关的”,通过增加一个部分的复杂性来修复问题通常将慢慢地增加其他部分的复杂性。通过增加功能、选项和配置是修复问题的最快的途径,但是这很容易让人忘记简洁的内涵,即从长远来看,简洁依然是好软件的关键因素。</p>
<p>简洁的设计需要在工作开始的时候舍弃不必要的想法,并且在软件的生命周期内严格区别好的改变和坏的改变。通过足够的努力,一个好的改变可以在不破坏原有完整概念的前提下保持自适应,正如<a href="http://www.cs.unc.edu/%7Ebrooks/">Fred Brooks</a>所说的“概念完整性”;而一个坏的改变则不能达到这个效果,它们仅仅是通过肤浅的和简单的妥协来破坏原有设计的一致性。只有通过简洁的设计,才能让一个系统保持稳定、安全和持续的进化。</p>
<p>Go项目包括编程语言本身附带了相关的工具和标准库最后但并非代表不重要的是关于简洁编程哲学的宣言。就事后诸葛的角度来看Go语言的这些地方都做的还不错拥有自动垃圾回收、一个包系统、函数作为一等公民、词法作用域、系统调用接口、只读的UTF8字符串等。但是Go语言本身只有很少的特性也不太可能添加太多的特性。例如它没有隐式的数值转换没有构造函数和析构函数没有运算符重载没有默认参数也没有继承没有泛型没有异常没有宏没有函数修饰更没有线程局部存储。但是语言本身是成熟和稳定的而且承诺保证向后兼容用之前的Go语言编写程序可以用新版本的Go语言编译器和标准库直接构建而不需要修改代码。</p>
<p>Go语言有足够的类型系统以避免动态语言中那些粗心的类型错误但是Go语言的类型系统相比传统的强类型语言又要简洁很多。虽然有时候这会导致一个“无类型”的抽象类型概念但是Go语言程序员并不需要像<code>C++</code><code>Haskell</code>程序员那样纠结于具体类型的安全属性。在实践中Go语言简洁的类型系统给程序员带来了更多的安全性和更好的运行时性能。</p>
<p>Go语言鼓励当代计算机系统设计的原则特别是局部的重要性。它的内置数据类型和大多数的准库数据结构都经过精心设计而避免显式的初始化或隐式的构造函数因为很少的内存分配和内存初始化代码被隐藏在库代码中了。Go语言的聚合类型结构体和数组可以直接操作它们的元素只需要更少的存储空间、更少的内存写操作而且指针操作比其他间接操作的语言也更有效率。由于现代计算机是一个并行的机器Go语言提供了基于<code>CSP</code>的并发特性支持。Go语言的动态栈使得轻量级线程<code>goroutine</code>的初始栈可以很小,因此,创建一个<code>goroutine</code>的代价很小,创建百万级的<code>goroutine</code>完全是可行的。</p>
<p>Go语言的标准库通常被称为语言自带的电池提供了清晰的构建模块和公共接口包含I/O操作、文本处理、图像、密码学、网络和分布式应用程序等并支持许多标准化的文件格式和编解码协议。库和工具使用了大量的约定来减少额外的配置和解释从而最终简化程序的逻辑而且每个Go程序结构都是如此的相似因此Go程序也很容易学习。使用Go语言自带工具构建Go语言项目只需要使用文件名和标识符名称一个偶尔的特殊注释来确定所有的库、可执行文件、测试、基准测试、例子、以及特定于平台的变量、项目的文档等Go语言源代码本身就包含了构建规范。</p>
<h2 id="本书的组织"><a class="header" href="#本书的组织">本书的组织</a></h2>
<p>我们假设你已经有一种或多种其他编程语言的使用经历不管是类似C、C++或Java的编译型语言还是类似Python、Ruby、JavaScript的脚本语言因此我们不会像对完全的编程语言初学者那样解释所有的细节。因为Go语言的变量、常量、表达式、控制流和函数等基本语法也是类似的。</p>
<p>第一章包含了本教程的基本结构通过十几个程序介绍了用Go语言如何实现类似读写文件、文本格式化、创建图像、网络客户端和服务器通讯等日常工作。</p>
<p>第二章描述了Go语言程序的基本元素结构、变量、新类型定义、包和文件、以及作用域等概念。第三章讨论了数字、布尔值、字符串和常量并演示了如何显示和处理Unicode字符。第四章描述了复合类型从简单的数组、字典、切片到动态列表。第五章涵盖了函数并讨论了错误处理、panic和recover还有defer语句。</p>
<p>第一章到第五章是基础部分主流命令式编程语言这部分都类似。个别之处Go语言有自己特色的语法和风格但是大多数程序员能很快适应。其余章节是Go语言特有的方法、接口、并发、包、测试和反射等语言特性。</p>
<p>Go语言的面向对象机制与一般语言不同。它没有类层次结构甚至可以说没有类仅仅通过组合而不是继承简单的对象来构建复杂的对象。方法不仅可以定义在结构体上而且可以定义在任何用户自定义的类型上并且具体类型和抽象类型接口之间的关系是隐式的所以很多类型的设计者可能并不知道该类型到底实现了哪些接口。方法在第六章讨论接口在第七章讨论。</p>
<p>第八章讨论了基于顺序通信进程CSP概念的并发编程使用goroutines和channels处理并发编程。第九章则讨论了传统的基于共享变量的并发编程。</p>
<p>第十章描述了包机制和包的组织结构。这一章还展示了如何有效地利用Go自带的工具使用单个命令完成编译、测试、基准测试、代码格式化、文档以及其他诸多任务。</p>
<p>第十一章讨论了单元测试Go语言的工具和标准库中集成了轻量级的测试功能避免了强大但复杂的测试框架。测试库提供了一些基本构件必要时可以用来构建复杂的测试构件。</p>
<p>第十二章讨论了反射一种程序在运行期间审视自己的能力。反射是一个强大的编程工具不过要谨慎地使用这一章利用反射机制实现一些重要的Go语言库函数展示了反射的强大用法。第十三章解释了底层编程的细节在必要时可以使用unsafe包绕过Go语言安全的类型系统。</p>
<p>每一章都有一些练习题你可以用来测试你对Go的理解你也可以探讨书中这些例子的扩展和替代。</p>
<p>书中所有的代码都可以从 http://gopl.io 上的Git仓库下载。go get命令根据每个例子的导入路径智能地获取、构建并安装。只需要选择一个目录作为工作空间然后将GOPATH环境变量设置为该路径。</p>
<p>必要时Go语言工具会创建目录。例如</p>
<pre><code>$ export GOPATH=$HOME/gobook # 选择工作目录
$ go get gopl.io/ch1/helloworld # 获取/编译/安装
$ $GOPATH/bin/helloworld # 运行程序
Hello, 世界 # 这是中文
</code></pre>
<p>运行这些例子需要安装Go1.5以上的版本。</p>
<pre><code>$ go version
go version go1.5 linux/amd64
</code></pre>
<p>如果使用其他的操作系统,请参考 https://golang.org/doc/install 提供的说明安装。</p>
<h2 id="更多的信息"><a class="header" href="#更多的信息">更多的信息</a></h2>
<p>最佳的帮助信息来自Go语言的官方网站https://golang.org 它提供了完善的参考文档包括编程语言规范和标准库等诸多权威的帮助信息。同时也包含了如何编写更地道的Go程序的基本教程还有各种各样的在线文本资源和视频资源它们是本书最有价值的补充。Go语言的官方博客 https://blog.golang.org 会不定期发布一些Go语言最好的实践文章包括当前语言的发展状态、未来的计划、会议报告和Go语言相关的各种会议的主题等信息译注 http://talks.golang.org/ 包含了官方收录的各种报告的讲稿)。</p>
<p>在线访问的一个有价值的地方是可以从web页面运行Go语言的程序而纸质书则没有这么便利了。这个功能由来自 https://play.golang.org 的 Go Playground 提供,并且可以方便地嵌入到其他页面中,例如 https://golang.org 的主页,或 godoc 提供的文档页面中。</p>
<p>Playground可以简单的通过执行一个小程序来测试对语法、语义和对程序库的理解类似其他很多语言提供的REPL即时运行的工具。同时它可以生成对应的url非常适合共享Go语言代码片段汇报bug或提供反馈意见等。</p>
<p>基于 Playground 构建的 Go Tourhttps://tour.golang.org 是一个系列的Go语言入门教程它包含了诸多基本概念和结构相关的并可在线运行的互动小程序。</p>
<p>当然Playground 和 Tour 也有一些限制它们只能导入标准库而且因为安全的原因对一些网络库做了限制。如果要在编译和运行时需要访问互联网对于一些更复杂的实验你可能需要在自己的电脑上构建并运行程序。幸运的是下载Go语言的过程很简单从 https://golang.org 下载安装包应该不超过几分钟译注感谢伟大的长城让大陆的Gopher们都学会了自己打洞的基本生活技能下载时间可能会因为洞的大小等因素从几分钟到几天或更久然后就可以在自己电脑上编写和运行Go程序了。</p>
<p>Go语言是一个开源项目你可以在 https://golang.org/pkg 阅读标准库中任意函数和类型的实现代码,和下载安装包的代码完全一致。这样,你可以知道很多函数是如何工作的, 通过挖掘找出一些答案的细节或者仅仅是出于欣赏专业级Go代码。</p>
<h2 id="致谢"><a class="header" href="#致谢">致谢</a></h2>
<p><a href="http://genius.cat-v.org/rob-pike/">Rob Pike</a><a href="http://research.swtch.com/">Russ Cox</a>以及很多其他Go团队的核心成员多次仔细阅读了本书的手稿他们对本书的组织结构和表述用词等给出了很多宝贵的建议。在准备日文版翻译的时候Yoshiki Shibata更是仔细地审阅了本书的每个部分及时发现了诸多英文和代码的错误。我们非常感谢本书的每一位审阅者并感谢对本书给出了重要的建议的Brian Goetz、Corey Kosak、Arnold Robbins、Josh Bleecher Snyder和Peter Weinberger等人。</p>
<p>我们还感谢Sameer Ajmani、Ittai Balaban、David Crawshaw、Billy Donohue、Jonathan Feinberg、Andrew Gerrand、Robert Griesemer、John Linderman、Minux Ma译注中国人Go团队成员。、Bryan Mills、Bala Natarajan、Cosmos Nicolaou、Paul Staniforth、Nigel Tao译注好像是陶哲轩的兄弟以及Howard Trickey给出的许多有价值的建议。我们还要感谢David Brailsford和Raph Levien关于类型设置的建议。</p>
<p>我们从来自Addison-Wesley的编辑Greg Doench收到了很多帮助从最开始就得到了越来越多的帮助。来自AW生产团队的John Fuller、Dayna Isley、Julie Nahil、Chuti Prasertsith到Barbara Wood感谢你们的热心帮助。</p>
<p><a href="https://github.com/adonovan">Alan Donovan</a>特别感谢Sameer Ajmani、Chris Demetriou、Walt Drummond和Google公司的Reid Tatge允许他有充裕的时间去写本书感谢Stephen Donovan的建议和始终如一的鼓励以及他的妻子Leila Kazemi并没有让他为了家庭琐事而分心并热情坚定地支持这个项目。</p>
<p><a href="http://www.cs.princeton.edu/%7Ebwk/">Brian Kernighan</a>特别感谢朋友和同事对他的耐心和宽容让他慢慢地梳理本书的写作思路。同时感谢他的妻子Meg和其他很多朋友对他写作事业的支持。</p>
<p>2015年 10月 于 纽约</p>
<!-- 公众号 -->
<hr>
<table>
<tr>
<td>
<img width="222px" src="https://chai2010.cn/advanced-go-programming-book/css.png">
</td>
<td>
<img width="222px" src="https://chai2010.cn/advanced-go-programming-book/cch.png">
</td>
</tr>
</table>
<div id="giscus-container"></div>
<footer class="page-footer">
<span>© 2015-2016 | <a href="https://github.com/gopl-zh"> Go语言圣经中文版</a>, 仅学习交流使用</span>
</footer>
</main>
<nav class="nav-wrapper" aria-label="Page navigation">
<!-- Mobile navigation buttons -->
<a rel="prev" href="preface-zh.html" class="mobile-nav-chapters previous" title="Previous chapter" aria-label="Previous chapter" aria-keyshortcuts="Left">
<i class="fa fa-angle-left"></i>
</a>
<a rel="next" href="ch1/ch1.html" class="mobile-nav-chapters next" title="Next chapter" aria-label="Next chapter" aria-keyshortcuts="Right">
<i class="fa fa-angle-right"></i>
</a>
<div style="clear: both"></div>
</nav>
</div>
</div>
<nav class="nav-wide-wrapper" aria-label="Page navigation">
<a rel="prev" href="preface-zh.html" class="nav-chapters previous" title="Previous chapter" aria-label="Previous chapter" aria-keyshortcuts="Left">
<i class="fa fa-angle-left"></i>
</a>
<a rel="next" href="ch1/ch1.html" class="nav-chapters next" title="Next chapter" aria-label="Next chapter" aria-keyshortcuts="Right">
<i class="fa fa-angle-right"></i>
</a>
</nav>
</div>
<script type="text/javascript">
window.playground_copyable = true;
</script>
<script src="elasticlunr.min.js" type="text/javascript" charset="utf-8"></script>
<script src="mark.min.js" type="text/javascript" charset="utf-8"></script>
<script src="searcher.js" type="text/javascript" charset="utf-8"></script>
<script src="clipboard.min.js" type="text/javascript" charset="utf-8"></script>
<script src="highlight.js" type="text/javascript" charset="utf-8"></script>
<script src="book.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript" charset="utf-8">
var pagePath = "preface.md"
</script>
<!-- Custom JS scripts -->
<script type="text/javascript" src="js/custom.js"></script>
<script type="text/javascript" src="js/bigPicture.js"></script>
</body>
</html>