Go 官方文档:从安装与入门教程到 Gin 网络接口教程的学习路线
文档首页的分组
文档首页分为 Getting Started 和 Developing modules 等栏目。Getting Started 下列出 Installing Go、Tutorial: Getting started、Tutorial: Create a module、多模块工作区教程、用 Go 与 Gin 开发 RESTful API 的教程、泛型教程和模糊测试教程;此外还有 Writing Web Applications、How to write Go code 和 A Tour of Go 等条目。页面说明 A Tour of Go 是分为四个部分的交互式入门。
Developing modules 栏目列出 Developing and publishing modules、Module release and versioning workflow、Managing module source 和 Organizing a Go module 等条目,讲解如何组织模块、发布模块以及管理版本。

页面顶部导航的 Docs 下拉菜单包含 Go Spec、Go User Manual、Standard library、Release Notes 和 Effective Go,另有 Packages 入口,标准库入口指向 pkg.go.dev/std。
教程:用 Gin 编写 RESTful 接口
“Tutorial: Developing a RESTful API with Go and Gin”介绍如何用 Go 和 Gin Web Framework 编写 RESTful Web 服务接口。Gin 用于路由请求、读取请求细节以及把数据编码为 JSON 返回。教程要完成的是一个有两个端点的 API 服务器,示例数据是一个老爵士唱片的记录库。
教程的端点设计如下:/albums 的 GET 返回全部专辑的 JSON 列表,POST 从请求中添加一张新专辑。教程的小节包括设计 API 端点、为代码创建文件夹、创建数据、编写返回全部条目的处理函数、编写添加新条目的处理函数,以及编写返回指定条目的处理函数。

教程的前提包括:最新版本的 Go、任一文本编辑器、命令行终端(Linux、macOS 上为常用终端,Windows 上为 PowerShell 或 cmd),以及 curl 工具。页面提示,如果是第一次接触 Go,应先阅读“Tutorial: Get started with Go”。页面还提供在 Google Cloud Shell 中以交互方式完成本教程的按钮。