Skip to content
This repository has been archived by the owner on Nov 22, 2018. It is now read-only.

Commit

Permalink
fixed several issues
Browse files Browse the repository at this point in the history
  • Loading branch information
mikespook committed Aug 20, 2014
1 parent 8b6b4c9 commit d83cac8
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 29 deletions.
7 changes: 4 additions & 3 deletions content/basics.article
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Go 作者组
http://golang.org

* Packages
*

每个 Go 程序都是由包组成的。

Expand Down Expand Up @@ -187,13 +187,14 @@ Go 的基本类型有Basic types
var i int
j := i // j 也是一个 int

But when the right hand side contains an untyped numeric constant, the new variable may be an `int`, `float64`, or `complex128` depending on the precision of the constant:
但是当右边包含了未指名类型的数字常量时,新的变量就可能是 `int`、`float64` 或 `complex128`。
这取决于常量的精度:

i := 42 // int
f := 3.142 // float64
g := 0.867 + 0.5i // complex128

Try changing the initial value of `v` in the example code and observe how its type is affected.
尝试修改演示代码中 `v` 的初始值,并观察这是如何影响其类型的。

.play basics/type-inference.go

Expand Down
2 changes: 1 addition & 1 deletion content/methods.article
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ Go 标准库包含了这个接口的[[http://golang.org/search?q=Read#Global][

`At` 应当返回一个颜色;在这个例子里,在最后一个图片生成器的值 `v` 匹配 `color.RGBA{v, v, 255, 255}`。

.play prog/tour/exercise-images.go
.play methods/exercise-images.go

* 恭喜!

Expand Down
2 changes: 1 addition & 1 deletion content/moretypes.article
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
复杂类型: struct、slice 和 map。
学习如何基于已有类型定义新的类型:本课涵盖了结构体、数组、slice 和 map。

Go 作者组
http://golang.org

Expand Down
42 changes: 21 additions & 21 deletions static/js/values.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,43 +9,43 @@ angular.module('tour.values', []).
// List of modules with description and lessons in it.
value('tableOfContents', [{
'id': 'mechanics',
'title': 'Using the tour',
'description': '<p>Welcome to a tour of the <a href="http://golang.org">Go programming language</a>. The tour covers the most important features of the language, mainly:</p>',
'title': '指南的使用',
'description': '<p>欢迎来到 <a href="http://golang.org">Go 编程语言</a>指南。本指南涵盖了该语言的大部分重要特性,主要包括:</p>',
'lessons': ['welcome']
}, {
'id': 'basics',
'title': 'Basics',
'description': '<p>The starting point, learn all the basics of the language.</p><p>Declaring variables, calling functions, and all the things you need to know before moving to the next lessons.</p>',
'title': '基础',
'description': '<p>一开始,将学习关于语言的所有基础内容。</p><p>定义变量、调用函数、以及在你学习下一课之前所需要了解的全部内容。</p>',
'lessons': ['basics', 'flowcontrol', 'moretypes']
}, {
'id': 'methods',
'title': 'Methods and interfaces',
'description': '<p>Learn how to define methods on types, how to declare interfaces, and how to put everything together.</p>',
'title': '方法和接口',
'description': '<p>学习如何为类型定义方法;如何定义接口;以及如何将所有内容贯通起来。</p>',
'lessons': ['methods']
}, {
'id': 'concurrency',
'title': 'Concurrency',
'description': '<p>Go provides concurrency features as part of the core language.</p><p>This module goes over goroutines and channels, and how they are used to implement different concurrency patterns.</p>',
'title': '并发',
'description': '<p>作为语言的核心部分,Go 提供了并发的特性。</p><p>这一部分概览了 goroutein 和 channel,以及如何使用它们来实现不同的并发模式。</p>',
'lessons': ['concurrency']
}]).

// translation
value('translation', {
'off': 'off',
'on': 'on',
'syntax': 'Syntax-Highlighting',
'lineno': 'Line-Numbers',
'reset': 'Reset Slide',
'format': 'Format Source Code',
'kill': 'Kill Program',
'run': 'Run',
'compile': 'Compile and Run',
'more': 'Options',
'toc': 'Table of Contents',
'prev': 'Previous',
'next': 'Next',
'waiting': 'Waiting for remote server...',
'errcomm': 'Error communicating with remote server.',
'syntax': '语法高亮',
'lineno': '行号',
'reset': '重置',
'format': '格式化源代码',
'kill': '杀死进程',
'run': '运行',
'compile': '编译并运行',
'more': '选项',
'toc': '目录',
'prev': '向前',
'next': '向后',
'waiting': '等待远端服务器响应...',
'errcomm': '与远端服务器通讯失败。',
}).

// Config for codemirror plugin
Expand Down
2 changes: 1 addition & 1 deletion static/partials/list.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<div class="container">

<div class="page-header">
<h1>Welcome to a tour of Go</h1>
<h1>欢迎使用 Go 指南</h1>
</div>

<div class="module" ng-repeat="m in toc.modules">
Expand Down
4 changes: 2 additions & 2 deletions template/index.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

<head>
<meta charset="utf-8">
<title>A Tour of Go</title>
<title>Go 指南</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="mobile-web-app-capable" content="yes">
Expand All @@ -15,7 +15,7 @@

<body>
<div class="bar top-bar">
<a class="left logo" href="/list">A Tour of Go</a>
<a class="left logo" href="/list">Go 指南</a>
<div table-of-contents-button=".toc"></div>
</div>

Expand Down

0 comments on commit d83cac8

Please sign in to comment.