mirror of
https://github.com/usual2970/certimate.git
synced 2025-06-08 05:29:51 +00:00
chore: config gofumpt
This commit is contained in:
parent
7ef885319e
commit
cf3de10eff
12
.vscode/settings.json
vendored
12
.vscode/settings.json
vendored
@ -6,5 +6,15 @@
|
|||||||
"source.fixAll.eslint": "explicit"
|
"source.fixAll.eslint": "explicit"
|
||||||
},
|
},
|
||||||
"editor.defaultFormatter": "esbenp.prettier-vscode",
|
"editor.defaultFormatter": "esbenp.prettier-vscode",
|
||||||
"editor.formatOnSave": true
|
"editor.formatOnSave": true,
|
||||||
|
"go.useLanguageServer": true,
|
||||||
|
"gopls": {
|
||||||
|
"formatting.gofumpt": true,
|
||||||
|
},
|
||||||
|
"[go]": {
|
||||||
|
"editor.defaultFormatter": "golang.go"
|
||||||
|
},
|
||||||
|
"[typescript]": {
|
||||||
|
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
||||||
|
}
|
||||||
}
|
}
|
@ -28,6 +28,7 @@ git clone https://github.com/your_username/certimate.git
|
|||||||
|
|
||||||
1. 进入根目录
|
1. 进入根目录
|
||||||
2. 运行以下命令启动服务:
|
2. 运行以下命令启动服务:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
go run main.go serve
|
go run main.go serve
|
||||||
```
|
```
|
||||||
@ -36,11 +37,12 @@ git clone https://github.com/your_username/certimate.git
|
|||||||
|
|
||||||
**在向主仓库提交 PR 之前,建议你:**
|
**在向主仓库提交 PR 之前,建议你:**
|
||||||
|
|
||||||
|
- 使用 [gofumpt](https://github.com/mvdan/gofumpt) 对你的代码进行格式化。
|
||||||
|
|
||||||
- 为你的改动添加单元测试或集成测试(Certimate 使用 Go 的标准 `testing` 包)。你可以通过以下命令运行测试(在项目根目录下):
|
- 为你的改动添加单元测试或集成测试(Certimate 使用 Go 的标准 `testing` 包)。你可以通过以下命令运行测试(在项目根目录下):
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
go test ./...
|
go test ./...
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## 修改管理页面 (Admin UI)
|
## 修改管理页面 (Admin UI)
|
||||||
@ -49,9 +51,12 @@ Certimate 的管理页面是一个基于 React 和 Vite 构建的单页应用(
|
|||||||
|
|
||||||
要启动 Admin UI:
|
要启动 Admin UI:
|
||||||
|
|
||||||
1. 进入 `ui` 项目目录
|
1. 进入 `ui` 项目目录。
|
||||||
2. 运行 `npm install` 安装依赖
|
|
||||||
|
2. 运行 `npm install` 安装依赖。
|
||||||
|
|
||||||
3. 启动 Vite 开发服务器:
|
3. 启动 Vite 开发服务器:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
npm run dev
|
npm run dev
|
||||||
```
|
```
|
||||||
|
@ -27,7 +27,9 @@ git clone https://github.com/your_username/certimate.git
|
|||||||
Once you have made changes to the Go code in Certimate, follow these steps to run the project:
|
Once you have made changes to the Go code in Certimate, follow these steps to run the project:
|
||||||
|
|
||||||
1. Navigate to the root directory.
|
1. Navigate to the root directory.
|
||||||
|
|
||||||
2. Start the service by running:
|
2. Start the service by running:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
go run main.go serve
|
go run main.go serve
|
||||||
```
|
```
|
||||||
@ -36,6 +38,8 @@ This will start a web server at `http://localhost:8090` using the prebuilt Admin
|
|||||||
|
|
||||||
**Before submitting a PR to the main repository, consider:**
|
**Before submitting a PR to the main repository, consider:**
|
||||||
|
|
||||||
|
- Format your source code by using [gofumpt](https://github.com/mvdan/gofumpt).
|
||||||
|
|
||||||
- Adding unit or integration tests for your changes. Certimate uses Go’s standard `testing` package. You can run tests using the following command (while in the root project directory):
|
- Adding unit or integration tests for your changes. Certimate uses Go’s standard `testing` package. You can run tests using the following command (while in the root project directory):
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
@ -49,11 +53,15 @@ Certimate’s Admin UI is a single-page application (SPA) built using React and
|
|||||||
To start the Admin UI:
|
To start the Admin UI:
|
||||||
|
|
||||||
1. Navigate to the `ui` project directory.
|
1. Navigate to the `ui` project directory.
|
||||||
|
|
||||||
2. Install the necessary dependencies by running:
|
2. Install the necessary dependencies by running:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
npm install
|
npm install
|
||||||
```
|
```
|
||||||
|
|
||||||
3. Start the Vite development server:
|
3. Start the Vite development server:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
npm run dev
|
npm run dev
|
||||||
```
|
```
|
||||||
|
Loading…
x
Reference in New Issue
Block a user