Skip to content
Navigation Menu
Sign in
Products
Platform
GitHub
Repository hosting, code review, and collaboration
Copilot
AI coding agent for tasks, projects and automated work
Build & Ship
Actions
CI/CD and automation
Code Quality
Quality analysis, fixes, and enforcement
Codespaces
Cloud development environments
Secure
Code Security
Vulnerability detection and remediation
Secret Protection
Secret scanning and leak prevention
All Features
Developers
Learn
Documentation
Training
Certifications
Build
Build with Copilot
Customize Copilot
Integrations
Explore
Trending repos
GitHub Sponsors
Events
Changelog
Changelog
Your source for the latest features, improvements, and fixes across GitHub products, all in one place.
Businesses
By Stage
Enterprises
Team
Startups
Nonprofits
By Industry
Healthcare
Financial services
Manufacturing
Government
See all industries
Evaluate GitHub
Why GitHub
Customer Stories
Business insights
Trust Center
Add-ons
GitHub Advanced Security
Enterprise-grade code security
Copilot for business
Enterprise-grade AI features
Premium Support
Enterprise-grade 24/7 support
Resources
Learn & Connect
Documentation
Resource center
Blog
Events & webinars
Community Forum
Customer Stories
Integrations
Support
Customer support
Training
GitHub Status
Company
About
Partners
Changelog
GitHub Universe
GitHub Universe
The event for developers, by developers — talks, workshops, and what’s next for GitHub.
Pricing
Search
/
Sign in
Sign up
Appearance settings
You signed in with another tab or window.
Reload
to refresh your session.
You signed out in another tab or window.
Reload
to refresh your session.
You switched accounts on another tab or window.
Reload
to refresh your session.
Dismiss alert
{{ message }}
studying-notes
go-notes
Repository navigation
Code
Issues
Pull requests
7
(7)
Actions
Projects
Security and quality
Insights
More
items
Files
Expand file tree
main
Breadcrumbs
go-notes
/
quickstart
/
cli
/
README.md
Copy path
Blame
More file actions
Blame
More file actions
Latest commit
History
History
History
62 lines (40 loc) · 1.79 KB
main
Breadcrumbs
go-notes
/
quickstart
/
cli
/
README.md
Copy path
Top
File metadata and controls
Code
Blame
62 lines (40 loc) · 1.79 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
---
date: 2022-07-19T10:26:22+08:00
author: "Rustle Karl"
title: "Go 命令行简介"
url: "posts/go/quickstart/cli/README" # 永久链接
tags: [ "Go", "README" ] # 标签
categories: [ "Go 学习笔记" ] # 分类
toc: true # 目录
draft: true # 草稿
---
显示帮助:
```shell
go help command
```
## packages
```shell
go help packages
```
大部分命令都作用于 packages 集合:
```shell
go action [packages]
```
通常,[packages] 是一个导入路径列表。导入路径是作为根路径或以 . 或 .. 符号可被解释为文件系统路径并表示该目录中的包。
如果没有给出导入路径,则表示当前目录。
有 4 个保留名称:
- main 表示独立可执行文件的顶级包
- all GOPATH 中的全部包
- std 全部标准库
- cmd 内置命令和库
`cmd/` 起始的导入路径只匹配 Go 仓库源码。
如果导入路径包含一个或多个“...”通配符,则它是一种模式,每个都可以匹配任何字符串,包括空字符串和包含斜杠的字符串。 这样的模式扩展到所有包在 GOPATH 树中找到名称匹配的目录模式。
但存在两个特殊情况:
- /... 可以匹配空字符串,所以 net/... 匹配 net 及其子目录,比如 net/http。
- 任何包含通配符的以斜线分隔的模式元素都不会参与到 vendor 包路径中的 vendor 元素的匹配中,因此 ./... 不匹配 ./vendor 或 ./mycode/ 子目录中的包 vendor,但是 ./vendor/... 和 ./mycode/vendor/... 可以。 但是请注意,一个名为 vendor 且本身包含代码的目录不是一个 vendored 包: cmd/vendor 将是一个名为 vendor 的命令,并且模式 cmd/... 与之匹配。
以 . 或者 _ 开始的目录或文件会被忽略。
名为 testdata 的目录也被忽略。
```shell
```
```shell
```
You can’t perform that action at this time.