三个点“./..."是什么意思?在 Go 命令行调用中是什么意思? [英] What do three dots "./..." mean in Go command line invocations?

查看:25
本文介绍了三个点“./..."是什么意思?在 Go 命令行调用中是什么意思?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果您在 Travis CI 上运行 Golang 测试,它将用三个点下载您的所有依赖项:

If you run Golang tests on Travis CI, it will download all of your dependencies with three dots:

go get -d -v ./... && go build -v ./...

./... 表示或扩展到那里是什么?我做了一些研究,但它似乎不是 Unix 约定.

What does ./... indicate or expand to there? I've done some research but it doesn't seem to be a Unix convention.

推荐答案

来自命令go help packages:

如果导入路径包含一个或多个..."通配符,则它是一种模式,每个都可以匹配任何字符串,包括空字符串和包含斜线的字符串.这样的模式扩展到所有包在 GOPATH 树中找到的名称与模式.作为一种特殊情况, x/... 匹配 x 以及 x 的子目录.例如,net/... 在其子目录中扩展为 net 和包.

An import path is a pattern if it includes one or more "..." wildcards, each of which can match any string, including the empty string and strings containing slashes. Such a pattern expands to all package directories found in the GOPATH trees with names matching the patterns. As a special case, x/... matches x as well as x's subdirectories. For example, net/... expands to net and packages in its subdirectories.

这篇关于三个点“./..."是什么意思?在 Go 命令行调用中是什么意思?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆