GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - ubgo/buildinfo-examples: Runnable example applications for github.com/ubgo/buildinfo — 11 examples covering basics, ldflags stamping, every HTTP framework adapter, OTEL, Zap, and slog.

BranchesTags
Open more actions menu

Latest commit

 

History

6 Commits
6 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
01-basic
01-basic
 
 
02-ldflags-stamping
02-ldflags-stamping
 
 
03-modules-list
03-modules-list
 
 
04-http-nethttp
04-http-nethttp
 
 
04b-http-gin
04b-http-gin
 
 
04c-http-chi
04c-http-chi
 
 
04d-http-echo
04d-http-echo
 
 
04e-http-fiber
04e-http-fiber
 
 
05-with-otel-resource
05-with-otel-resource
 
 
06-with-zap
06-with-zap
 
 
07-with-slog
07-with-slog
 
 
.editorconfig
.editorconfig
 
 
.gitignore
.gitignore
 
 
CONTRIBUTING.md
CONTRIBUTING.md
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
Taskfile.yml
Taskfile.yml
 
 
go.work
go.work
 
 

Repository files navigation

buildinfo-examples

Runnable example applications demonstrating every adapter and usage pattern of github.com/ubgo/buildinfo.

Each example is a self-contained Go module under its own subdirectory. Clone the repo, cd into any example, and run go run . to see the feature working end-to-end.

Quick start

git clone https://github.com/ubgo/buildinfo-examples.git
cd buildinfo-examples/01-basic
go run .

Learning path

Basics

  • 01-basic — auto-populated Info via runtime/debug.ReadBuildInfo.
  • 02-ldflags-stamping — CI-style version stamping with -ldflags (Makefile included).
  • 03-modules-list — dump dependency modules — SBOM-friendly.

HTTP framework adapters

Each example boots a tiny server and exposes /version. The shape of the API (Handler, Mount, WithPath, WithMiddleware) is uniform across all five frameworks.

  • 04-http-nethttp — stdlib net/http.
  • 04b-http-gin — Gin + auth middleware example.
  • 04c-http-chi — Chi.
  • 04d-http-echo — Echo.
  • 04e-http-fiber — Fiber.

Observability + logger adapters

  • 05-with-otel-resource — OpenTelemetry resource attributes.
  • 06-with-zap — Zap log fields and namespace.
  • 07-with-slog — stdlib log/slog Attrs and group.

Versioning

Each example's go.mod pins specific upstream versions of ubgo/buildinfo and any contrib adapters it imports. When a new minor release of the lib lands, all examples are updated in one PR.

During pre-v1.0 development, examples use replace directives that point at sibling local clones of ubgo/buildinfo. After tagging, the replace directives are removed.

Compatibility

Requires Go 1.24 or later.

License

Apache License 2.0. See LICENSE.

About

Runnable example applications for github.com/ubgo/buildinfo — 11 examples covering basics, ldflags stamping, every HTTP framework adapter, OTEL, Zap, and slog.

Resources

Readme
Apache-2.0 license

Contributing

Contributing
Activity
Custom properties

Stars

0 stars

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.