Skip to content

Commit f22cdbc

Browse files
committed
chore: update README
1 parent b6cbeb5 commit f22cdbc

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,8 @@ Remove /Users/voidint/.g
196196
197197
## FAQ
198198
199+
200+
199201
- What is the purpose of the environment variable `G_MIRROR`?
200202
201203
Due to the restricted access to the Golang official website in mainland China, it has become difficult to query and download go versions. Therefore, the environment variable `G_MIRROR` can be used to specify one or multiple mirror sites (separated by commas) from which g will query and download available go versions. The known available mirror sites are as follows:
@@ -206,6 +208,14 @@ Remove /Users/voidint/.g
206208
- Huazhong University of Science and Technology: https://mirrors.hust.edu.cn/golang/
207209
- University of Science and Technology of China: https://mirrors.ustc.edu.cn/golang/
208210
211+
- What URLs can be used as values for `G_MIRROR`?
212+
213+
`g` retrieves Go version information by parsing web pages and implements several version collectors for specific page structures. Currently supported collectors include:
214+
215+
- **Official Collector**: For Go official website. Any page with HTML structure identical to the Go official download page (e.g. `https://go.dev/dl/`) can use this collector. Example: `G_MIRROR=official|https://golang.google.cn/dl/`, where the part before `|` is the collector name and the part after is the target page URL.
216+
- **FancyIndex Collector**: For pages rendered by Nginx FancyIndex module. Example: `G_MIRROR=fancyindex|https://mirrors.aliyun.com/golang/`.
217+
- **AutoIndex Collector**: For pages rendered by Nginx AutoIndex module. Example: `G_MIRROR=autoindex|https://mirrors.ustc.edu.cn/golang/`.
218+
209219
- What is the purpose of the environment variable `G_EXPERIMENTAL`?
210220
211221
When the value of this environment variable is set to true, it enables all experimental features.

README_CN.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,13 @@ Remove /Users/voidint/.g
206206
- 华中科技大学开源镜像站:https://mirrors.hust.edu.cn/golang/
207207
- 中国科学技术大学开源镜像站:https://mirrors.ustc.edu.cn/golang/
208208
209+
- 哪些站点的 URL 可以作为`G_MIRROR`的值?
210+
`g`通过网页解析的方式获取其中包含的 Go 版本信息,针对特定类型的网页结构实现了若干的版本采集器。目前支持的采集器包括以下几种:
211+
- **Official Collector** :Go官网采集器。只要网页 HTML 结构和 golang 官方下载页面(如`https://go.dev/dl/`)一致,都可以使用该采集器。设置示例,如`G_MIRROR=official|https://golang.google.cn/dl/`,其中,`|`之前的部分为采集器名称,之后的部分为目标页面的 URL。
212+
- **FancyIndex Collector**:适用于 Nginx FancyIndex 模块渲染的网页。设置示例,如`G_MIRROR=fancyindex|https://mirrors.aliyun.com/golang/`。
213+
- **AutoIndex Collector**:适用于 Nginx AutoIndex 模块渲染的网页。设置示例,如`G_MIRROR=autoindex|https://mirrors.ustc.edu.cn/golang/`。
214+
215+
209216
- 环境变量`G_EXPERIMENTAL`有什么作用?
210217
211218
当该环境变量的值为`true`时,将**开启所有的实验特性**。

0 commit comments

Comments
 (0)