Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Go 语言命令概览 #5744

Merged
merged 9 commits into from May 17, 2019
Merged

Go 语言命令概览 #5744

merged 9 commits into from May 17, 2019

Conversation

ghost
Copy link

@ghost ghost commented May 9, 2019

译文翻译完成,resolve #5649

@ghost ghost changed the title squash! Create an-overview-of-go-tooling.md (#5647) Go 语言工具概述 resolve #5649 May 9, 2019
@ghost ghost marked this pull request as ready for review May 9, 2019 01:06
@leviding leviding added the 后端 label May 9, 2019
@leviding leviding changed the title Go 语言工具概述 resolve #5649 Go 语言工具概述 May 9, 2019
@sunui sunui mentioned this pull request May 9, 2019
@jianboy
Copy link
Contributor

jianboy commented May 10, 2019

校对认领

@fanyijihua
Copy link
Collaborator

@jianboy 好的呢 🍺

Copy link
Contributor

@jianboy jianboy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

初步校对好了

TODO1/an-overview-of-go-tooling.md Outdated Show resolved Hide resolved
TODO1/an-overview-of-go-tooling.md Outdated Show resolved Hide resolved
TODO1/an-overview-of-go-tooling.md Outdated Show resolved Hide resolved
TODO1/an-overview-of-go-tooling.md Outdated Show resolved Hide resolved
TODO1/an-overview-of-go-tooling.md Outdated Show resolved Hide resolved
TODO1/an-overview-of-go-tooling.md Outdated Show resolved Hide resolved
TODO1/an-overview-of-go-tooling.md Outdated Show resolved Hide resolved
TODO1/an-overview-of-go-tooling.md Outdated Show resolved Hide resolved

```shell
$ go list -m -u all
```

You can upgrade (or downgrade) a dependency to the latest version, specific tagged-release or commit hash with the `go get` command like so:
你可以使用 `go get` 命令将依赖项升级(或降级)到最新版本、特定标记版本或提交 hash ,如下所示:
Copy link
Contributor

@jianboy jianboy May 10, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(或降级)到最新版本

(或降级) 删掉, 降级只能到老版本。。。

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

特定标记版本或提交 hash
=》
特定 tag 的版本或特点 hash 的版本

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

升级到最新版本、调整为特定 tag 或 hash 的版本
这样如何?

TODO1/an-overview-of-go-tooling.md Outdated Show resolved Hide resolved
@ghost ghost changed the title Go 语言工具概述 Go 语言工具概览 May 10, 2019
iceytea added 2 commits May 10, 2019 21:14
全文替换:
竞态条件检测 => 竞争检测
标记 => 参数
@jianboy
Copy link
Contributor

jianboy commented May 10, 2019

还有再说一下, An Overview of Go's Tooling

这里的 Go's Tooling 不是中文意思的go语言工具! 原文讲的是 go 语言的一些命令使用。比如 go run /go build

Copy link
Contributor

@jianboy jianboy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

校对完了,请修改吧

TODO1/an-overview-of-go-tooling.md Outdated Show resolved Hide resolved
iceytea added 2 commits May 10, 2019 23:01
一些微小的修复。有争议的地方先按照校对意见来修改。
@ghost ghost changed the title Go 语言工具概览 Go 语言命令概览 May 10, 2019
录入校对者信息
修改遗漏问题
@ghost
Copy link
Author

ghost commented May 10, 2019

@jianboy 修改完成,请查看下

@shixi-li
Copy link
Contributor

校对认领

@fanyijihua
Copy link
Collaborator

@shixi-li 妥妥哒 🍻

@sunui
Copy link
Contributor

sunui commented May 15, 2019

@shixi-li 来校对啦

Copy link
Contributor

@shixi-li shixi-li left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

校对完成,请看看呢。

TODO1/an-overview-of-go-tooling.md Outdated Show resolved Hide resolved

这篇文章中,我将主要关注 go 命令这部分。但这里也将提到一些不属于 Go 12.2 标准发行版的内容。

当你在 Go 12.2 版本下安装命令时,你首先需要确定当前在 module-enabled 的目录**之外**(我通常跳转到 `/tmp` 目录下)。之后你可以使用 `GO111MODULE=on go get` 命令来安装。例如:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

module-enabled 在上文中已经被译者翻译为了“启用模块”,建议统一翻译或者统一不译。

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

你首先需要确定
=>
你首先需要确保


# Go 语言命令概览

我偶尔会被人问到:**“你为什么喜欢使用 Go 语言?”** 我经常提到的一件事情是,作为 `go` 命令的一部分 —— 与 Go 语言一同存在的 —— `go fmt` 和 `go build`,以及其它像 `go tool pprof` 这样只用来帮助解决特定问题的命令。但在任何情况下,我都很感谢它们使我的项目管理和维护更容易。
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这段翻译需要译者再着重斟酌,个人建议如下供参考。

我偶尔会被人问到:“你为什么喜欢使用 Go 语言?” 我经常会提到的就是go 工具命令,它是与语言一同存在的一部分。有一些命令比如像 go fmtgo build 我每天都会用到,还有一些命令就像是 go tool pprof 是用来解决特定的问题。但在所有的场景下,我都很感谢 go 命令让我的项目管理和维护变得更加容易。

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

感觉通顺多了😀

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

稍微调整了下,现在是这样:

我偶尔会被人问到:“你为什么喜欢使用 Go 语言?” 我经常会提到的就是 go 工具命令,它是与语言一同存在的一部分。有一些命令 —— 比如 go fmtgo build —— 我每天都会用到,还有一些命令 —— 就像 go tool pprof —— 我用它们解决特定的问题。但在所有的场景下,我都很感谢 go 命令让我的项目管理和维护变得更加容易。

TODO1/an-overview-of-go-tooling.md Outdated Show resolved Hide resolved
TODO1/an-overview-of-go-tooling.md Outdated Show resolved Hide resolved
```

Typically I run my tests with Go's [race detector](https://golang.org/doc/articles/race_detector.html) enabled, which can help pick up **some** of the data races that might occur in real-life usage. Like so:
通常我会在启用 Go 的 [竞争检测](https://golang.org/doc/articles/race_detector.html) 的情况下运行我的测试,这可以帮助我找到在实际使用中可能出现的一些数据竞态情况。就像这样:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

的情况下运行我的测试
=>
运行我的测试

Copy link
Author

@ghost ghost May 16, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

通常我会在启用 Go 的 竞争检测 运行我的测试

感觉有点奇怪,所以我调整了下语序。
我在 bing 上搜索了竞争检测,返回以下结果。看起来“竞争检测”做名词用的时候被翻译成“竞争检测器”

image

因此我感觉这里可以调整为:

我会在运行测试时启用 Go 的 竞争检测器,这可以帮助我找到在实际使用中可能出现的一些数据竞争情况。

你看这样行吗?

Copy link
Contributor

@shixi-li shixi-li May 17, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

我开始想表达的其实是修改为“通常我会启用 Go 的竞争检测运行我的测试”。但是我觉得你最新的调整会更好。

TODO1/an-overview-of-go-tooling.md Outdated Show resolved Hide resolved
TODO1/an-overview-of-go-tooling.md Outdated Show resolved Hide resolved

However, there are a handful of very specific issues that it does deal with. You can see a summary of them by running `go tool fix -help`. If you decide that you want or need to run `go fix` after upgrading, you should you run the following command, then inspect a diff of the changes before you commit them.
但是,在某些具体的问题上,`go fix` 的确起到了作用。你可以通过运行 `go tool fix -help` 来查看它们的摘要,如果你决定在升级后需要运行 `go fix` ,则应该运行以下命令,然后在提交之前检查更改的差异。
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

来查看它们的摘要
=>
来查看它们的变更信息

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

go tool fix -help 显示的是命令 go tool fix 的帮助信息,这里我感觉“它们的摘要”可以改为 go tool fix 命令的概述。

image

@shixi-li 你怎么看?

Copy link
Contributor

@shixi-li shixi-li May 17, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

可以的,对于这一段我最开始的理解有问题,你的修改很棒

TODO1/an-overview-of-go-tooling.md Outdated Show resolved Hide resolved
@leviding leviding added the 标注 待管理员 Review label May 17, 2019
Copy link
Member

@leviding leviding left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

很赞喔,有一点细节格式问题,我给修改啦,注意看一下。

@leviding leviding merged commit 93a26e0 into xitu:master May 17, 2019
@leviding
Copy link
Member

@IceyTea 已经 merge 啦~ 快快麻溜发布到掘金然后给我发下链接,方便及时添加积分哟。

文章发布时,标题前面那个大图,你可以在上传掘金的时候作为题图使用,然后在文中删除那个图就行啦。

掘金翻译计划有自己的知乎专栏,你也可以投稿哈,推荐使用一个好用的插件
专栏地址:https://zhuanlan.zhihu.com/juejinfanyi

@leviding leviding added 翻译完成 and removed 标注 待管理员 Review 正在校对 labels May 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Go 语言工具概述
5 participants