> For the complete documentation index, see [llms.txt](https://willh.gitbook.io/build-web-application-with-golang-zhtw/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://willh.gitbook.io/build-web-application-with-golang-zhtw/02.0/02.8.md).

# 小結

這一章我們主要介紹了 Go 語言的一些語法，透過語法我們可以發現 Go 是多麼的簡單，只有二十五個關鍵字。讓我們再來回顧一下這些關鍵字都是用來幹什麼的。

```go
break    default      func    interface    select
case     defer        go      map          struct
chan     else         goto    package      switch
const    fallthrough  if      range        type
continue for          import  return       var
```

* var 和 const 參考 2.2Go 語言基礎裡面的變數和常數宣告
* package 和 import 已經有過短暫的接觸
* func 用於定義函式和方法
* return 用於從函式回傳
* defer 用於類似解構函式
* go 用於併發
* select 用於選擇不同型別的通訊
* interface 用於定義介面，參考 2.6 小節
* struct 用於定義抽象資料型別，參考 2.5 小節
* break、case、continue、for、fallthrough、else、if、switch、goto、default 這些參考 2.3 流程介紹裡面
* chan 用於 channel 通訊
* type 用於宣告自訂型別
* map 用於宣告 map 型別資料
* range 用於讀取 slice、map、channel 資料

上面這二十五個關鍵字記住了，那麼 Go 你也已經差不多學會了。

## links

* [目錄](https://github.com/doggy8088/build-web-application-with-golang-zhtw/tree/4cbbaa31bdfc3678915eb91f23db2f1bad554a20/preface.md)
* 上一節: [併發](/build-web-application-with-golang-zhtw/02.0/02.7.md)
* 下一章: [Web 基礎](/build-web-application-with-golang-zhtw/03.0.md)
