Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Go 基礎與模組管理

Go 語法基礎、模組系統與入門指南。

📖 基礎入門

學習筆記

實戰派教學

範例程式

📦 Go Modules

模組管理

🎯 語言特性

物件導向

  • OO - Go 的物件導向設計

Interface

💡 學習要點

Go 基礎語法

  1. 變數與類型

    • 基本類型
    • 複合類型(slice, map, struct)
    • 類型推導
  2. 控制流程

    • if/else
    • for 迴圈
    • switch
  3. 函數

    • 多返回值
    • 延遲執行(defer)
    • 閉包

Go Modules

  1. 模組初始化

    go mod init example.com/myproject
    
  2. 依賴管理

    go get package@version
    go mod tidy
    
  3. 版本控制

    • Semantic Versioning
    • go.mod 與 go.sum

最後更新: 2025-12-01