项目 / golang/example

golang/example

行业推荐
语言 Go标签 —数据更新 2026-11-25 06:49:28 · 仓库 2026-11-24

一段话介绍

Go example projects

本站整理,非 GitHub 官方 description。

官方 description(GitHub API 原样)
Go example projects
2,981累计星
1,012Fork
—峰值日增
0上榜次数
总榜
暂未入榜
日榜
暂未入榜
周榜
暂未入榜
月榜
暂未入榜

官方快照(gh_history.db,2026-11-25):总榜 未进 Top50 · 日榜 未进 Top50 · 周榜未满 7 天基线(官方不生成) · 月榜暂无官方口径;下方四卡为站内趋势聚合(周卡按上榜次数,非官方 7 日增量窗)。

行业与场景

按行业选型 →

智能题库与自动阅卷

适配系统:考试系统、题库系统 · 得分 1.3

提供组卷、作答与自动评分链路,可嵌入考试系统降低教师批改成本。

更多信息

以下三段按该项目自己的 GitHub README 章节摘录(可合理截断并标明);README 没有对应章节的留空,不编造。

我的用法
该仓库收录了一组 Go 示例程序与库,可通过阅读和运行其中代码来学习 Go 语言、标准库和工具的使用方法。
特点或设计要点
`hello` 与 `hello/reverse` 分别示范可执行命令和库包,覆盖命令行参数、日志和表驱动测试。`helloserver` 是最小的 HTTP 服务;`outyet` 进一步演示模板、后台任务、并发同步、监控变量和集成测试。此外还有 App Engine 入门示例 `appengine-hello`、`go/types` 类型检查教程 `gotypes`、模板 `block` 特性示例,以及编写 `log/slog` Handler 的指南。
星标走势还差一天的数据,明天就能看到曲线
每天 10:30 记一次星标,连续两天后自动生成曲线
首次发现 — · 最近在榜 2026-09-17 · 语言 Go · 贡献者 —
go

GitHub 项目主页介绍

来自 GitHub 仓库 README / 主页介绍正文,原样摘录,共 3,214 字节。

# Go example projects

[![Go Reference](https://pkg.go.dev/badge/golang.org/x/example.svg)](https://pkg.go.dev/golang.org/x/example)

This repository contains a collection of Go programs and libraries that
demonstrate the language, standard libraries, and tools.

## Clone the project

```
$ git clone https://go.googlesource.com/example
$ cd example
```
https://go.googlesource.com/example is the canonical Git repository.
It is mirrored at https://github.com/golang/example.

## [hello](hello/) and [hello/reverse](hello/reverse/)

```
$ cd hello
$ go build
$ ./hello -help
```
A trivial "Hello, world" program that uses a library package.

The [hello](hello/) command covers:

* The basic form of an executable command
* Importing packages (from the standard library and the local repository)
* Printing strings ([fmt](//golang.org/pkg/fmt/))
* Command-line flags ([flag](//golang.org/pkg/flag/))
* Logging ([log](//golang.org/pkg/log/))

The [reverse](hello/reverse/) reverse covers:

* The basic form of a library
* Conversion between string and []rune
* Table-driven unit tests ([testing](//golang.org/pkg/testing/))

## [helloserver](helloserver/)

```
$ cd helloserver
$ go run .
```

A trivial "Hello, world" web server.

Topics covered:

* Command-line flags ([flag](//golang.org/pkg/flag/))
* Logging ([log](//golang.org/pkg/log/))
* Web servers ([net/http](//golang.org/pkg/net/http/))

## [outyet](outyet/)

```
$ cd outyet
$ go run .
```
A web server that answers the question: "Is Go 1.x out yet?"

Topics covered:

* Command-line flags ([flag](//golang.org/pkg/flag/))
* Web servers ([net/http](//golang.org/pkg/net/http/))
* HTML Templates ([html/template](//golang.org/pkg/html/template/))
* Logging ([log](//golang.org/pkg/log/))
* Long-running background processes
* Synchronizing data access between goroutines ([sync](//golang.org/pkg/sync/))
* Exporting server state for monitoring ([expvar](//golang.org/pkg/expvar/))
* Unit and integration tests ([testing](//golang.org/pkg/testing/))
* Dependency injection
* Time ([time](//golang.org/pkg/time/))

## [appengine-hello](appengine-hello/)

A trivial "Hello, world" App Engine application intended to be used as the
starting point for your own code. Please see
[Google App Engine SDK for Go](https://cloud.google.com/appengine/downloads#Google_App_Engine_SDK_for_Go)
and [Quickstart for Go in the App Engine Standard Environment](https://cloud.google.com/appengine/docs/standard/go/quickstart).

## [gotypes](gotypes/)

The `go/types` package is a type-checker for Go programs. It is one of the most
complex packages in Go's standard library, so we have provided this tutorial to
help you find your bearings. It comes with several example programs that you
can obtain using `go get` and play with as you learn to build tools that analyze
or manipulate Go programs.

## [template](template/)

A trivial web server that demonstrates the use of the
[`template` package](https://golang.org/pkg/text/template/)'s `block` feature.

## [slog-handler-guide](slog-handler-guide/)

The `log/slog` package supports structured logging.
It features a flexible backend in the form of a `Handler` interface.
This guide can help you write your own handler.
↑