mirror of
https://github.com/gopl-zh/gopl-zh.github.com.git
synced 2025-09-09 21:32:09 +00:00
清理文件
This commit is contained in:
@@ -402,7 +402,7 @@ $ go list -json hash
|
||||
$ go list -f '{{join .Deps " "}}' strconv
|
||||
errors math runtime unicode/utf8 unsafe
|
||||
```
|
||||
{% endraw %}
|
||||
|
||||
|
||||
译注:上面的命令在Windows的命令行运行会遇到`template: main:1: unclosed action`的错误。产生这个错误的原因是因为命令行对命令中的`" "`参数进行了转义处理。可以按照下面的方法解决转义字符串的问题:
|
||||
|
||||
@@ -410,7 +410,7 @@ errors math runtime unicode/utf8 unsafe
|
||||
```
|
||||
$ go list -f "{{join .Deps \" \"}}" strconv
|
||||
```
|
||||
{% endraw %}
|
||||
|
||||
|
||||
下面的命令打印compress子目录下所有包的导入包列表:
|
||||
|
||||
@@ -423,7 +423,7 @@ compress/gzip -> bufio compress/flate errors fmt hash hash/crc32 io time
|
||||
compress/lzw -> bufio errors fmt io
|
||||
compress/zlib -> bufio compress/flate errors fmt hash hash/adler32 io
|
||||
```
|
||||
{% endraw %}
|
||||
|
||||
|
||||
译注:Windows下有同样有问题,要避免转义字符串的干扰:
|
||||
|
||||
@@ -431,7 +431,7 @@ compress/zlib -> bufio compress/flate errors fmt hash hash/adler32 io
|
||||
```
|
||||
$ go list -f "{{.ImportPath}} -> {{join .Imports \" \"}}" compress/...
|
||||
```
|
||||
{% endraw %}
|
||||
|
||||
|
||||
`go list`命令对于一次性的交互式查询或自动化构建或测试脚本都很有帮助。我们将在11.2.4节中再次使用它。每个子命令的更多信息,包括可设置的字段和意义,可以用`go help list`命令查看。
|
||||
|
||||
|
Reference in New Issue
Block a user