@mai0313/go_template 0.1.15 → 0.1.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +44 -4
- package/README.zh-CN.md +44 -4
- package/README.zh-TW.md +44 -4
- package/binaries/linux-arm64-gnu/go_template +0 -0
- package/binaries/linux-x64-gnu/go_template +0 -0
- package/binaries/macos-arm64/go_template +0 -0
- package/binaries/macos-x64/go_template +0 -0
- package/binaries/windows-arm64/go_template.exe +0 -0
- package/binaries/windows-x64/go_template.exe +0 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -52,11 +52,51 @@ Run the example CLI:
|
|
|
52
52
|
./build/go_template --version
|
|
53
53
|
```
|
|
54
54
|
|
|
55
|
-
|
|
55
|
+
## Using as a Template
|
|
56
56
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
57
|
+
**IMPORTANT**: This is a template, not a library. You must rename `go_template` to your project name.
|
|
58
|
+
|
|
59
|
+
### Quick Setup
|
|
60
|
+
|
|
61
|
+
1. Click **Use this template** to create your repository
|
|
62
|
+
2. Clone your new repository
|
|
63
|
+
3. Run the rename script or follow manual steps below
|
|
64
|
+
|
|
65
|
+
### Manual Rename Steps
|
|
66
|
+
|
|
67
|
+
**Required changes** (replace `{your_project}` with your actual project name):
|
|
68
|
+
|
|
69
|
+
1. **Go Module**:
|
|
70
|
+
|
|
71
|
+
- Update `go.mod`: `module go_template` → `module {your_project}`
|
|
72
|
+
- Rename `cmd/go_template/` → `cmd/{your_project}/`
|
|
73
|
+
- Update imports in `cmd/{your_project}/main.go`
|
|
74
|
+
- Update `Makefile` LDFLAGS (lines 17-19) and `BIN_NAME` (line 23)
|
|
75
|
+
|
|
76
|
+
2. **CLI Wrappers** (if using npm/PyPI distribution):
|
|
77
|
+
|
|
78
|
+
- Node.js: Update `cli/nodejs/package.json` and `cli/nodejs/bin/start.js`
|
|
79
|
+
- Python: Update `cli/python/pyproject.toml` and rename `cli/python/src/go_template/`
|
|
80
|
+
|
|
81
|
+
3. **Docker**:
|
|
82
|
+
|
|
83
|
+
- Update `docker/Dockerfile` labels and binary paths
|
|
84
|
+
- Update `.devcontainer/Dockerfile` labels
|
|
85
|
+
|
|
86
|
+
4. **Documentation**:
|
|
87
|
+
|
|
88
|
+
- Update badge URLs in `README.md`, `README.zh-CN.md`, `README.zh-TW.md`
|
|
89
|
+
- Update `.github/CODEOWNERS`
|
|
90
|
+
|
|
91
|
+
**Verification**:
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
make clean && make build
|
|
95
|
+
./build/{your_project} --version
|
|
96
|
+
grep -r "go_template" --exclude-dir=.git --exclude-dir=build .
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
For detailed instructions, see [.github/copilot-instructions.md](.github/copilot-instructions.md).
|
|
60
100
|
|
|
61
101
|
## Project Structure
|
|
62
102
|
|
package/README.zh-CN.md
CHANGED
|
@@ -52,11 +52,51 @@ make build-all # 交叉编译常见 OS/ARCH
|
|
|
52
52
|
./build/go_template --version
|
|
53
53
|
```
|
|
54
54
|
|
|
55
|
-
|
|
55
|
+
## 作为模板使用
|
|
56
56
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
57
|
+
**重要提示**:这是一个模板,不是库。你必须将 `go_template` 重命名为你的项目名称。
|
|
58
|
+
|
|
59
|
+
### 快速设置
|
|
60
|
+
|
|
61
|
+
1. 点击 **使用此模板** 创建你的仓库
|
|
62
|
+
2. 克隆你的新仓库
|
|
63
|
+
3. 运行重命名脚本或按照下方手动步骤操作
|
|
64
|
+
|
|
65
|
+
### 手动重命名步骤
|
|
66
|
+
|
|
67
|
+
**必需修改**(将 `{your_project}` 替换为你的实际项目名称):
|
|
68
|
+
|
|
69
|
+
1. **Go 模块**:
|
|
70
|
+
|
|
71
|
+
- 更新 `go.mod`:`module go_template` → `module {your_project}`
|
|
72
|
+
- 重命名 `cmd/go_template/` → `cmd/{your_project}/`
|
|
73
|
+
- 更新 `cmd/{your_project}/main.go` 中的导入
|
|
74
|
+
- 更新 `Makefile` 的 LDFLAGS(第17-19行)和 `BIN_NAME`(第23行)
|
|
75
|
+
|
|
76
|
+
2. **CLI 包装器**(如果使用 npm/PyPI 分发):
|
|
77
|
+
|
|
78
|
+
- Node.js:更新 `cli/nodejs/package.json` 和 `cli/nodejs/bin/start.js`
|
|
79
|
+
- Python:更新 `cli/python/pyproject.toml` 并重命名 `cli/python/src/go_template/`
|
|
80
|
+
|
|
81
|
+
3. **Docker**:
|
|
82
|
+
|
|
83
|
+
- 更新 `docker/Dockerfile` 标签和二进制路径
|
|
84
|
+
- 更新 `.devcontainer/Dockerfile` 标签
|
|
85
|
+
|
|
86
|
+
4. **文档**:
|
|
87
|
+
|
|
88
|
+
- 更新 `README.md`、`README.zh-CN.md`、`README.zh-TW.md` 中的徽章 URL
|
|
89
|
+
- 更新 `.github/CODEOWNERS`
|
|
90
|
+
|
|
91
|
+
**验证**:
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
make clean && make build
|
|
95
|
+
./build/{your_project} --version
|
|
96
|
+
grep -r "go_template" --exclude-dir=.git --exclude-dir=build .
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
详细说明请参见 [.github/copilot-instructions.md](.github/copilot-instructions.md)。
|
|
60
100
|
|
|
61
101
|
## 项目结构
|
|
62
102
|
|
package/README.zh-TW.md
CHANGED
|
@@ -52,11 +52,51 @@ make build-all # 跨平台編譯常見 OS/ARCH
|
|
|
52
52
|
./build/go_template --version
|
|
53
53
|
```
|
|
54
54
|
|
|
55
|
-
|
|
55
|
+
## 作為模板使用
|
|
56
56
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
57
|
+
**重要提示**:這是一個模板,不是函式庫。你必須將 `go_template` 重新命名為你的專案名稱。
|
|
58
|
+
|
|
59
|
+
### 快速設定
|
|
60
|
+
|
|
61
|
+
1. 點擊 **使用此模板** 建立你的倉庫
|
|
62
|
+
2. 複製你的新倉庫
|
|
63
|
+
3. 執行重新命名腳本或按照下方手動步驟操作
|
|
64
|
+
|
|
65
|
+
### 手動重新命名步驟
|
|
66
|
+
|
|
67
|
+
**必要修改**(將 `{your_project}` 替換為你的實際專案名稱):
|
|
68
|
+
|
|
69
|
+
1. **Go 模組**:
|
|
70
|
+
|
|
71
|
+
- 更新 `go.mod`:`module go_template` → `module {your_project}`
|
|
72
|
+
- 重新命名 `cmd/go_template/` → `cmd/{your_project}/`
|
|
73
|
+
- 更新 `cmd/{your_project}/main.go` 中的匯入
|
|
74
|
+
- 更新 `Makefile` 的 LDFLAGS(第17-19行)和 `BIN_NAME`(第23行)
|
|
75
|
+
|
|
76
|
+
2. **CLI 包裝器**(如果使用 npm/PyPI 發佈):
|
|
77
|
+
|
|
78
|
+
- Node.js:更新 `cli/nodejs/package.json` 和 `cli/nodejs/bin/start.js`
|
|
79
|
+
- Python:更新 `cli/python/pyproject.toml` 並重新命名 `cli/python/src/go_template/`
|
|
80
|
+
|
|
81
|
+
3. **Docker**:
|
|
82
|
+
|
|
83
|
+
- 更新 `docker/Dockerfile` 標籤和二進位路徑
|
|
84
|
+
- 更新 `.devcontainer/Dockerfile` 標籤
|
|
85
|
+
|
|
86
|
+
4. **文件**:
|
|
87
|
+
|
|
88
|
+
- 更新 `README.md`、`README.zh-CN.md`、`README.zh-TW.md` 中的徽章 URL
|
|
89
|
+
- 更新 `.github/CODEOWNERS`
|
|
90
|
+
|
|
91
|
+
**驗證**:
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
make clean && make build
|
|
95
|
+
./build/{your_project} --version
|
|
96
|
+
grep -r "go_template" --exclude-dir=.git --exclude-dir=build .
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
詳細說明請參見 [.github/copilot-instructions.md](.github/copilot-instructions.md)。
|
|
60
100
|
|
|
61
101
|
## 專案結構
|
|
62
102
|
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mai0313/go_template",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.20",
|
|
4
4
|
"description": "A production-ready Go project template to bootstrap new projects fast. It includes a clean Go module layout, Docker, and a complete CI/CD suite.",
|
|
5
5
|
"author": "Wei Lee <mai@mai0313.com>",
|
|
6
6
|
"license": "MIT",
|