Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update zh-tw documentations for the gin-gonic website #244

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion content/en/docs/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,3 @@ We provide API usage [examples](https://github.com/gin-gonic/examples) and list
* Tell us your success stories using Gin
* Tell us how we can improve Gin and help us do it
* Contribute to an existing library

12 changes: 12 additions & 0 deletions content/zh-tw/docs/deployment/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,18 @@ weight: 6

Gin 專案可以輕鬆部署到任意雲主機商。

## [Koyeb](https://www.koyeb.com)

Koyeb 是一個開發者友善的無伺服器平台,可透過基於 Git 的部署在全球部署應用程式,支援 TLS 加密、本地自動擴展、全球邊緣網絡,以及內建的服務網格與發現功能。

請參照 Koyeb [指南部署您的 Gin 專案](https://www.koyeb.com/tutorials/deploy-go-gin-on-koyeb)。

## [Qovery](https://www.qovery.com)

Qovery 提供免費的雲端主機托管,包括資料庫、SSL、全球 CDN,以及使用 Git 進行自動部署。

請參照 Qovery 指南來[部署您的 Gin 項目](https://docs.qovery.com/guides/tutorial/deploy-gin-with-postgresql/)。

## [Render](https://render.com)

Render 是一個原生支援 Go 語言的現代化雲平台,並支持管理 SSL、資料庫、不停機部署、HTTP/2 和 websocket。
Expand Down
6 changes: 3 additions & 3 deletions content/zh-tw/docs/jsoniter/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ draft: false
weight: 5
---

#### Build with [jsoniter](https://github.com/json-iterator/go)
## Build with [jsoniter](https://github.com/json-iterator/go)

Gin uses `encoding/json` as default json package but you can change to [jsoniter](https://github.com/json-iterator/go) by build from other tags.
Gin 使用 `encoding/json` 作為預設的 JSON 套件,但您可以通過使用其他標籤進行構建以切換到 [jsoniter](https://github.com/json-iterator/go)

```sh
$ go build -tags=jsoniter .
```
```
27 changes: 5 additions & 22 deletions content/zh-tw/docs/quickstart/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ draft: false
weight: 2
---

- [需求](#需求)
- [安裝](#安裝)
- [開始使用](#開始使用)
在這個快速入門中,我們將從程式碼片段中獲得洞察並學習如何:

## 需求

Expand All @@ -29,39 +27,24 @@ import "github.com/gin-gonic/gin"
```

3. (可選的)如果你想要使用像是 `http.StatusOK` 的常數,你會需要匯入 `net/http` 套件

```go
import "net/http"
```

### 使用 vendor 工具像是 [Govendor](https://github.com/kardianos/govendor)

1. `go get` govendor

```sh
$ go get github.com/kardianos/govendor
```

2. 新增你的專案資料夾並 `cd` 進入
1. 新增你的專案資料夾並 `cd` 進入

```sh
$ mkdir -p $GOPATH/src/github.com/myusername/project && cd "$_"
```

3. Vendor init 專案並加入 gin

```sh
$ govendor init
$ govendor fetch github.com/gin-gonic/[email protected]
```

4. 複製範本到你的專案
2. 複製範本到你的專案

```sh
$ curl https://raw.githubusercontent.com/gin-gonic/examples/master/basic/main.go > main.go
```

5. 執行你的專案
3. 執行你的專案

```sh
$ go run main.go
Expand Down
2 changes: 1 addition & 1 deletion content/zh-tw/docs/testing/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ draft: false
weight: 7
---

##### 如何為 Gin 寫測試案例?
## 如何為 Gin 寫測試案例?

傾向使用 `net/http/httptest` 套件來做 HTTP 測試。

Expand Down