-
Notifications
You must be signed in to change notification settings - Fork 5k
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
Go 语言命令概览 #5744
Conversation
校对认领 |
@jianboy 好的呢 🍺 |
There was a problem hiding this 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
|
||
```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 ,如下所示: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(或降级)到最新版本
(或降级) 删掉, 降级只能到老版本。。。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
特定标记版本或提交 hash
=》
特定 tag 的版本或特点 hash 的版本
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
升级到最新版本、调整为特定 tag 或 hash 的版本
这样如何?
全文替换: 竞态条件检测 => 竞争检测 标记 => 参数
还有再说一下, An Overview of Go's Tooling 这里的 Go's Tooling 不是中文意思的go语言工具! 原文讲的是 go 语言的一些命令使用。比如 go run /go build |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
校对完了,请修改吧
一些微小的修复。有争议的地方先按照校对意见来修改。
录入校对者信息 修改遗漏问题
@jianboy 修改完成,请查看下 |
校对认领 |
@shixi-li 妥妥哒 🍻 |
@shixi-li 来校对啦 |
There was a problem hiding this 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
|
||
这篇文章中,我将主要关注 go 命令这部分。但这里也将提到一些不属于 Go 12.2 标准发行版的内容。 | ||
|
||
当你在 Go 12.2 版本下安装命令时,你首先需要确定当前在 module-enabled 的目录**之外**(我通常跳转到 `/tmp` 目录下)。之后你可以使用 `GO111MODULE=on go get` 命令来安装。例如: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
module-enabled 在上文中已经被译者翻译为了“启用模块”,建议统一翻译或者统一不译。
There was a problem hiding this 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
|
||
# Go 语言命令概览 | ||
|
||
我偶尔会被人问到:**“你为什么喜欢使用 Go 语言?”** 我经常提到的一件事情是,作为 `go` 命令的一部分 —— 与 Go 语言一同存在的 —— `go fmt` 和 `go build`,以及其它像 `go tool pprof` 这样只用来帮助解决特定问题的命令。但在任何情况下,我都很感谢它们使我的项目管理和维护更容易。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这段翻译需要译者再着重斟酌,个人建议如下供参考。
我偶尔会被人问到:“你为什么喜欢使用 Go 语言?” 我经常会提到的就是go
工具命令,它是与语言一同存在的一部分。有一些命令比如像 go fmt
和 go build
我每天都会用到,还有一些命令就像是 go tool pprof
是用来解决特定的问题。但在所有的场景下,我都很感谢 go
命令让我的项目管理和维护变得更加容易。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
感觉通顺多了😀
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
稍微调整了下,现在是这样:
我偶尔会被人问到:“你为什么喜欢使用 Go 语言?” 我经常会提到的就是
go
工具命令,它是与语言一同存在的一部分。有一些命令 —— 比如go fmt
和go build
—— 我每天都会用到,还有一些命令 —— 就像go tool pprof
—— 我用它们解决特定的问题。但在所有的场景下,我都很感谢 go 命令让我的项目管理和维护变得更加容易。
``` | ||
|
||
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) 的情况下运行我的测试,这可以帮助我找到在实际使用中可能出现的一些数据竞态情况。就像这样: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
的情况下运行我的测试
=>
运行我的测试
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
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
|
||
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` ,则应该运行以下命令,然后在提交之前检查更改的差异。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
来查看它们的摘要
=>
来查看它们的变更信息
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
可以的,对于这一段我最开始的理解有问题,你的修改很棒
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
很赞喔,有一点细节格式问题,我给修改啦,注意看一下。
@IceyTea 已经 merge 啦~ 快快麻溜发布到掘金然后给我发下链接,方便及时添加积分哟。 文章发布时,标题前面那个大图,你可以在上传掘金的时候作为题图使用,然后在文中删除那个图就行啦。 掘金翻译计划有自己的知乎专栏,你也可以投稿哈,推荐使用一个好用的插件。 |
译文翻译完成,resolve #5649