{"id":13678142,"url":"https://github.com/gobyexample-cn/gobyexample","last_synced_at":"2025-05-15T05:05:22.091Z","repository":{"id":15779539,"uuid":"18518628","full_name":"gobyexample-cn/gobyexample","owner":"gobyexample-cn","description":"Go by Example 通过例子学 Golang","archived":false,"fork":false,"pushed_at":"2024-04-29T08:58:06.000Z","size":8107,"stargazers_count":1925,"open_issues_count":10,"forks_count":323,"subscribers_count":48,"default_branch":"master","last_synced_at":"2025-05-04T05:02:04.681Z","etag":null,"topics":["book","go","gobyexample","golang","tutorial"],"latest_commit_sha":null,"homepage":"https://gobyexample-cn.github.io/","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gobyexample-cn.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2014-04-07T13:48:19.000Z","updated_at":"2025-05-02T09:30:58.000Z","dependencies_parsed_at":"2024-01-14T14:31:36.272Z","dependency_job_id":"f741e9e5-1c31-4389-9f72-c25bcc214d16","html_url":"https://github.com/gobyexample-cn/gobyexample","commit_stats":null,"previous_names":["xg-wang/gobyexample"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gobyexample-cn%2Fgobyexample","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gobyexample-cn%2Fgobyexample/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gobyexample-cn%2Fgobyexample/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gobyexample-cn%2Fgobyexample/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gobyexample-cn","download_url":"https://codeload.github.com/gobyexample-cn/gobyexample/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253426183,"owners_count":21906500,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["book","go","gobyexample","golang","tutorial"],"created_at":"2024-08-02T13:00:50.542Z","updated_at":"2025-05-15T05:05:22.066Z","avatar_url":"https://github.com/gobyexample-cn.png","language":"Go","readme":"## Go by Example 中文版\n\n[Go by Example](https://gobyexample-cn.github.io/) 是一个通过带注释的示例程序学习 Go 语言的网站。网站包含了从简单的 Hello World 到高级特性 Goroutine、Channel 等一系列示例程序，并附带了注释说明，非常适合 Go 语言初学者。\n\n如果您想学习 Go 语言基础知识，不要犹豫，请直接前往 [Go by Example](https://gobyexample-cn.github.io/) 开始学习！\n\n如果您觉得本项目还不错的话，记得回来给个 Star 哦 o(*￣▽￣*)ブ\n\n## 综述\n\n如果你想了解 Go by Example `网站` 是如何构建的，或者想为该项目贡献代码，请查看下面的内容：\n\n本项目包含了网站的内容和构建工具链，网站使用的是 `public` 目录下静态文件（html 等文件）的内容。它是这样被构建出来的：通过 `程序` 提取 `examples` 目录下的源码及注释，并使用 `templates` 目录下的静态文件模板将其渲染为静态文件，最终将生成的静态文件输出到 `public` 目录下。\n\n实现此构建过程的 `程序` 位于 `tools` 目录下，构建得到的 `public` 目录下的静态文件（html 等文件），可以部署到任何支持静态内容的系统。例如 S3、CloudFront 以及任何 Web 服务器。\n\n### 构建\n\n[![Build Status](https://github.com/mmcgrana/gobyexample/actions/workflows/test.yml/badge.svg?branch=master)](https://github.com/mmcgrana/gobyexample/actions)\n\n若想自行构建该网站，你需要安装 Go。然后运行下面的命令：\n\n```console\n$ tools/build\n```\n\n若想循环持续构建：\n\n```console\n$ tools/build-loop\n```\n\n在本地启动服务浏览网站\n\n```console\n$ tools/serve\n```\n\n然后再浏览器中打开 `http://127.0.0.1:8000/`\n\n### 发布\n\n下面的例子展示了如何将网站上传至 AWS：\n\n```console\n$ export AWS_ACCESS_KEY_ID=...\n$ export AWS_SECRET_ACCESS_KEY=...\n$ tools/upload\n```\n\n## 许可协议\n\n该项目的著作权归 Mark McGranaghan 所有，并遵循 [CC BY-SA 3.0](http://creativecommons.org/licenses/by/3.0/) 协议。\n\nGo Gopher 的版权归 [Renée French](http://reneefrench.blogspot.com/) 所有，并遵循 [CC BY-SA 3.0](http://creativecommons.org/licenses/by/3.0/) 协议。\n\n## 其他语言\n\n本项目只是 [mmcgrana](https://github.com/mmcgrana) 的 [Go by Example](https://github.com/mmcgrana/gobyexample) 项目的中文翻译。\n\n除中文版外，该项目还有以下语言：\n\n* [English](https://gobyexample.com) by [mmcgrana/gobyexample](https://github.com/mmcgrana/gobyexample)（原版）\n* [Czech](http://gobyexamples.sweb.cz/) by [martinkunc](https://github.com/martinkunc/gobyexample-cz)\n* [French](http://le-go-par-l-exemple.keiruaprod.fr) by [keirua](https://github.com/keirua/gobyexample)\n* [Italian](http://gobyexample.it) by the [Go Italian community](https://github.com/golangit/gobyexample-it)\n* [Japanese](http://spinute.org/go-by-example) by [spinute](https://github.com/spinute)\n* [Korean](https://mingrammer.com/gobyexample/) by [mingrammer](https://github.com/mingrammer)\n* [Russian](https://gobyexample.com.ru/) by [badkaktus](https://github.com/badkaktus)\n* [Spanish](http://goconejemplos.com) by the [Go Mexico community](https://github.com/dabit/gobyexample)\n* [Ukrainian](http://butuzov.github.io/gobyexample/) by [butuzov](https://github.com/butuzov/gobyexample)\n\n## 致谢\n\n感谢 [Jeremy Ashkenas](https://github.com/jashkenas) 的 [Docco](http://jashkenas.github.com/docco/)，启发了这个项目。\n\n## 贡献说明\n\n\u003e 从这部分开始，后面的内容都是中文版的贡献者们给自己加的戏。\n\u003e\n\u003e 好吧，其实前面的内容也加了很多戏，没有完全根据英文版翻译。\n\n如果你发现中文版的例子没有及时与英文版同步，或者你觉得某个例子翻译得不够好，甚至只是一个错误的文字、单词或符号，我们都 `非常欢迎` 你能够提交 pull request 以帮助我们使项目更完善，贡献流程大致如下：\n\n1. Fork 该仓库。\n1. 在 `examples` 目录下找到想要修改的例子，完成修改，这通常是以 `例子`（也就是一个目录）为单位进行修改，当然，你可以一次性修改多个例子。需要注意的是：只修改 `.go` 和 `.sh` 文件。`.hash` 文件是 `tools/build` 自动更新的，主要用于判断文件内容是否有改动；\n1. 使用 `tools/build` 命令重新生成静态文件。这一步会格式化代码，并判断内容是否有改动。对于内容有改动的例子，会自动将该例子的代码提交至 `https://play.studygolang.com/` 进行测试。通过测试后，会自动更新静态文件；\n1. `tools/serve` 本地预览效果；\n1. 通过自测后即可提交 pull request :)\n\n项目现由 [gobyexample-cn](https://github.com/gobyexample-cn) 维护，例子已完全与英文版同步（截止 2022-3-20），均为 79 个，可以在这里查看 [同步进度](PROGRESS.md)。\n\n后续可能会出现与英文版同步不及时的情况，`非常欢迎` 各位同学 fork 并提交 pull request。\n\n## 中文版的致谢\n\n感谢本翻译项目的原作者 [everyx](https://github.com/everyx)，完成了所有文件最初的翻译，同时也感谢项目每一位 [贡献者](https://github.com/gobyexample-cn/gobyexample/graphs/contributors) 的辛勤付出。\n\n`JetBrains` 公司为本项目提供了 free JetBrains Open Source license(s)，在此表示感谢。\n\n[![jetbrains](jetbrains-logo/jetbrains.svg)](https://www.jetbrains.com/?from=gobyexample-cn)\n[![jetbrains](jetbrains-logo/goland.svg)](https://www.jetbrains.com/?from=gobyexample-cn)\n[![jetbrains](jetbrains-logo/webstorm.svg)](https://www.jetbrains.com/?from=gobyexample-cn)\n","funding_links":[],"categories":["Go","Repositories"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgobyexample-cn%2Fgobyexample","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgobyexample-cn%2Fgobyexample","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgobyexample-cn%2Fgobyexample/lists"}