Skip to content

jun06t/go-sample

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

262 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

go-sample

A personal collection of small, self-contained Go samples that exercise language features, the standard library, third-party libraries, and surrounding middleware. Each top-level directory is an independent topic that can be run on its own with minimal setup.

Module: github.com/jun06t/go-sample (Go 1.24)

Index

Language / Tooling

Directory Description
cli-interface Building a CLI with the flag package (uppercase converter)
cfs Concurrent prime search used as a runtime-tracing demo
pipe A head-like tool driven by Unix-style stdin pipes
unix HTTP server over a Unix domain socket
shutdown-hook Graceful shutdown triggered by OS signals
modules Go Modules basics
toolchain / toolchain-library Experiments with the toolchain directive in go.mod
go-cmp Struct comparison and mock generation with google/go-cmp
yaml YAML parsing with environment-variable expansion

HTTP / Networking

Directory Description
http2 HTTP/2 server and client behavior
keep-alive Verifying HTTP keep-alive behavior
sse Server-Sent Events server and client
compress Response compression with memory profiling
request-body (placeholder)
error-middleware HTTP error-handling middleware
log-response Capturing HTTP responses via middleware

Logging / Observability

Directory Description
zap uber-go/zap configuration and multi-output examples
log-masking Masking sensitive fields in log output

Datastores

Directory Description
bigtable Cloud Bigtable client with App Profile usage
preparedstatement PostgreSQL prepared-statement performance comparison
nested-mongo-document Nested MongoDB documents (including BSON flattening)
causal-consistency MongoDB causal consistency (read-your-writes)
distributed-lock Distributed locking with etcd
firebase Firebase backend with a Vue.js front end

Security / Authorization / Feature Flags

Directory Description
crypto AES-GCM encryption and Argon2 hashing
open-policy-agent Policy evaluation with OPA
openfga ReBAC authorization with OpenFGA
openfeature Feature-flag management with OpenFeature
pgv Protocol Buffers validation with protoc-gen-validate

Algorithms / Data Structures

Directory Description
bandit Multi-armed bandit (Thompson sampling)
bloomfilter Bloom filter
radix-tree Radix tree vs. regex path-matching benchmark
weighted-random-choice Weighted random selection
guid UUID vs. Sonyflake vs. xid generation benchmark

DI / Plugins

Directory Description
wire Dependency injection with Google Wire (struct / interface / packages variants)
go-plugin-rpc RPC-based plugins via hashicorp/go-plugin

Usage

Each directory has its own entry point and can typically be run with go run or go test from inside it.

cd radix-tree
go test -bench . -benchmem

Samples that depend on external middleware (PostgreSQL, MongoDB, etcd, Bigtable, etc.) carry their own README and/or docker-compose.yml in the subdirectory.

License

MIT

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors