Skip to content

Instantly share code, notes, and snippets.

@appleboy
Last active August 9, 2023 14:53
Show Gist options
  • Save appleboy/fdd56b8be9d109848cf8d1198d3579f9 to your computer and use it in GitHub Desktop.
Save appleboy/fdd56b8be9d109848cf8d1198d3579f9 to your computer and use it in GitHub Desktop.
Go 語言基礎課程

Go 語言開發實戰從入門到進階

課程說明

Go 語言 (又稱 Golang) 是 Google 推出新一代的強大語言,2019 年 3 月 Google 公佈了去年底統計的問卷結果,發現 65% 用 Go 來寫網站,39% 用來開發系統程式,41% 用來做 DevOps (多重選擇),可想而知 Go 語言可以拿來從底層寫到上層。高效能的 Goroutine (併發) 表現優於 Parallelism (並行),語法上簡潔又簡單,這也就是為什麼我們要來嘗試 Go 語言。

Go 語言入門

時間 課程 時數
09:00 ~ 10:00 Go 語言開發環境 1
10:10 ~ 12:00 Go 基本語法特性 2
13:30 ~ 16:30 Go 併發基礎介紹 3
  • Go 語言開發環境
    • VSCode 環境介紹 (Go 語言相關設定及技巧)
    • Go Command 介紹 (go get, build, install .. 等指令技巧)
    • Go vendor vs Go module 介紹
    • GOPATH 目錄介紹 (src, pkg, bin 目錄)
    • 如何建立一個 Go 專案,並且導入 Unit Testing
  • Go 基本語法特性
    • 如何變數宣告 (區域變數 vs 全域變數)
    • 什麼是 Nil
    • Array vs Slice 區別 (記憶體變化)
    • for map vs for channel (for 迴圈注意事項)
    • Struct Method 介紹
      • Pointers vs Values 差異
      • 搭配 goroutine 發生什麼問題?
    • Interface{} 介紹
      • PHP Interface 轉 golang struct
      • Interface{} 當變數類型
      • Interface{} 作為函式參數 (fmt 擴充)
  • Go routine
    • 如何建立 goroutine
    • 如何實作同步
    • 避免 race condition
  • Go channel
    • 如何初始化 Channel
    • 什麼是 buffered vs unbuffered channel
    • 如何 closed channel
    • 用 for loop 讀取 channel
    • 設定專門讀寫 channel 流程

Go API 實戰

時間 課程 時數
09:00 ~ 11:00 Go Web 框架介紹及 API 實作 2
11:10 ~ 12:00 Go Command Line 實作 1
13:30 ~ 14:30 Go API Middleware 實作 1
14:30 ~ 15:30 Go API 測試 實作 1
15:30 ~ 16:30 Go GraphQL API 實作 (框架介紹與效能) 1
  • Go 框架介紹
    • 評估條件
    • 效能評估
  • Web API 實作
    • 使用 Gin 實作 CRUD API
  • CLI 實作
    • 目錄配置
    • 套件介紹
  • 專案 Config 配置
    • 搭配 Docker
    • 定義環境變數
    • 讀取環境變數
  • API 測試
  • Logger 介紹
  • 實作 Middleware
    • API Token 驗證
    • 使用 Contxt 存取資料
  • 資料庫串接
    • Xorm
    • Gorm
  • 資料庫測試
    • SQLite 開發
    • PostGres 或 MySQL 整合測試
  • GraphQL 介紹
    • 為什麼捨棄 Restful API
    • 框架介紹與效能
  • GraphQL 測試
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment