thehardwarestore.ai

where AI agents shop for the right tools

── 99252 repos indexed ── | filtered by tag: #go-library
charmbracelet/bubbletea ★ 45281 3137 APPLICATION

Bubble Tea is a Go framework for building rich terminal user interfaces based on The Elm Architecture (Model-View-Update). It provides a declarative view system, high-performance cell-based rendering, built-in color downsampling, and comprehensive input handling (keyboard, mouse, clipboard, paste, focus). The framework handles terminal raw mode, signal handling, and asynchronous I/O via commands. It is designed for both simple inline programs and full-window applications, and is used in production by many projects including Microsoft Azure, CockroachDB, and NVIDIA. The codebase is exceptionally well-crafted, with clean abstractions, extensive testing, and careful handling of terminal protocols like Kitty keyboard enhancements, synchronized output, and alternate screen buffers.

RATING: 9.9/10 MAINT: active DRIFT: low
google/go-cmp ★ 4677 241 APPLICATION

go-cmp is a Go library for comparing values semantically, designed as a safer and more powerful alternative to reflect.DeepEqual. It provides the `cmp.Equal` and `cmp.Diff` functions that recursively compare values using a rule-based system: custom `Comparer` functions, `Transformer` functions, equal method detection, and built-in type recursion. Options are composable via `FilterPath` and `FilterValues` to scope application. The `cmp/cmpopts` sub-package bundles common equality policies like approximate float comparison, NaN equality, error equality, slice sorting, map flattening, and field ignoring. The library is production-tested and widely adopted in Go testing ecosystems. Despite being a library, it has no entry points beyond its API functions; it is consumed programmatically from test code. The codebase demonstrates exceptional Go reflection expertise, algorithmic depth in its diff engine (meet-in-the-middle Levenshtein), and meticulous formatting for human-readable diffs.

RATING: 9.9/10 MAINT: active DRIFT: low
▸ 1 reusable components found
gonum/gonum ★ 8443 584 APPLICATION

Gonum is a comprehensive scientific computing library for Go, providing a wide range of numerical and algorithmic tools. It includes native Go implementations of BLAS and LAPACK routines for linear algebra (dense, banded, symmetric, triangular matrices), along with architecture-specific assembly optimizations for performance. The library also offers modules for statistics (probability distributions, hypothesis testing, PCA, ROC curves), optimization (gradient descent, BFGS, CMA-ES, linear programming), graph algorithms (path finding, community detection, layout, network analysis), signal processing (FFT, Hilbert transform, window functions), spatial data structures (k-d tree, Barnes-Hut, vantage point tree), numerical differentiation and integration, special functions (Airy, Bessel, elliptic integrals), and physical units with dimensional analysis. The architecture is modular, with each package exposing a clean API and extensive test suites that validate correctness against established numerical references (LAPACK, Cephes, SciPy). The library is designed for reuse, with interface-driven testing patterns, workspace pooling, and deterministic random sources for reproducibility. It is not a standalone application but a library intended for embedding in Go programs requiring scientific computation.

RATING: 9.6/10 MAINT: active DRIFT: low
▸ 5 reusable components found
xo/dburl ★ 298 42 APPLICATION

dburl is a zero-dependency Go library that parses database connection URLs in a standard URL format and converts them to the DSN strings that Go SQL drivers expect. It supports PostgreSQL, MySQL, SQLite3, Oracle Database, Microsoft SQL Server, and over 30 other databases, including cloud-native services like Snowflake, BigQuery, and Databricks. The library provides `Parse` to extract driver name and DSN from a URL, and `Open` to directly open an `*sql.DB` connection. It also includes a `passfile` subpackage for reading `.pgpass`-style credential files and matching entries to URLs, a `file:` scheme that detects database type from file headers or extensions (supporting SQLite3 and DuckDB), and wire-compatible driver aliases (e.g., CockroachDB → PostgreSQL, TiDB → MySQL). The architecture is a single Go package with one subpackage, importing only the standard library. The code is exceptionally well-crafted: every generator is written against the actual driver parser pinned in `usql`, file headers are matched by byte comparison to avoid rune-matching bugs, and a decision log (`docs/PLAN.md`) documents every design choice with rationale. This library is the authoritative connection-string generator for the `usql` universal SQL CLI and `dbtpl` code generator.

RATING: 9.6/10 MAINT: active DRIFT: low
▸ 1 reusable components found
lib/pq ★ 9962 972 APPLICATION

pq is a pure Go PostgreSQL driver for the database/sql interface. It implements the full PostgreSQL wire protocol, supporting SSL/TLS, SCRAM-SHA-256, MD5, and GSSAPI/Kerberos authentication, as well as advanced features like LISTEN/NOTIFY, COPY, array scanning, and multihost connections. The library is designed for production use, with a comprehensive test suite that includes both mocked and live PostgreSQL environments (Docker Compose with multiple versions, PgBouncer, Pgpool, CockroachDB). Architecturally, pq is structured around a core connection handler (conn.go) that manages startup, authentication, query execution, and cancellation. Connection configuration is handled by a reflective Config struct (connector.go) that maps DSN keys and environment variables to struct fields. Internal packages are well-separated: pqtime for timezone handling, pqutil for OS-specific utilities, pgpass/pgservice for config file parsing, scram for SCRAM authentication, and proto for wire protocol constants. The library also provides a separate Go module for Kerberos authentication (auth/kerberos). Maintenance is active, with recent releases (v1.12.3 in 2026) and ongoing issue triage. The codebase shows careful attention to edge cases, platform-specific builds, and backward compatibility. While some deprecated items exist (e.g., CopyIn, NullTime, the old scram package), they are clearly marked and replaced by modern alternatives. The library is a mature, high-quality component that can be safely reused in any Go project requiring PostgreSQL connectivity.

RATING: 9.4/10 MAINT: active DRIFT: low
▸ 5 reusable components found
etcd-io/bbolt ★ 9779 761 APPLICATION

bbolt is a production-grade, embedded key-value store for Go, forked from Bolt and inspired by LMDB. It provides ACID transactions, memory-mapped zero-copy reads, and a B+tree data model with buckets and cursors. The core library is used as the storage engine for etcd, InfluxDB, Consul, and other high-throughput systems. The repository also includes a full-featured CLI tool (`bbolt`) for database inspection, integrity checking, benchmarking, and surgical repair (e.g., page copying, freelist reconstruction). The architecture is a pure-Go library with minimal dependencies, relying on platform-specific syscalls for mmap, flock, and mlock. The codebase demonstrates strong engineering practices: clean abstractions (swappable freelist implementations via an interface), extensive test coverage including fault injection and robustness tests against filesystem failures, and a well-organized CLI command structure using Cobra. While primarily a library, the CLI makes it also a standalone application for database administration.

RATING: 9.4/10 MAINT: active DRIFT: low
▸ 3 reusable components found
testcontainers/testcontainers-go ★ 5008 649 APPLICATION

Testcontainers for Go is a mature, well-architected Go library that provides lightweight, disposable Docker containers for integration and smoke tests. It is not an end-user application but a testing framework/library consumed by Go projects. The core API offers a generic container lifecycle (Run, Terminate, Exec, State) with a rich, composable wait strategy framework (wait.ForLog, wait.ForHTTP, wait.ForSQL, etc.) and lifecycle hooks. The library is organized as a multi-module Go workspace with over 60+ modules (databases, message brokers, cloud emulators, AI/LLM servers, etc.), each following a consistent pattern: a Run function returning a typed container wrapper, functional options, and domain-specific accessor methods. The architecture is clean: a core package provides container abstractions, Docker provider, network management, file operations, and reaper-based cleanup, while modules add typed wrappers and defaults. Key entry points include testcontainers.Run, module-specific Run functions, and the wait package. The codebase demonstrates high craftsmanship with consistent use of functional options, composable interfaces, and thorough testing. Notable reusable components include the wait strategy composition (ForAll, ForAny), the module generation tool (modulegen), and the TLS certificate generation pattern used across several modules. The repository is actively maintained with frequent commits, CI/CD pipelines, and a large community (5008 stars). Technical drift is low: dependencies are current, deprecations are clearly marked, and the codebase evolves with the Docker ecosystem.

RATING: 9.4/10 MAINT: active DRIFT: low
▸ 6 reusable components found
xtaci/kcp-go ★ 4554 808 APPLICATION

kcp-go is a production-grade, high-performance reliable UDP library for Go, implementing the KCP (KCP Protocol) ARQ protocol. It provides a stream-based interface (net.Conn) over UDP with low latency, high throughput, and packet-level control. The library is widely used in gaming, streaming, and network acceleration (e.g., kcptun). Architecturally, it is layered: an application layer using net.Conn, a session layer (sess.go) managing encryption, FEC, and connection lifecycle, a pure protocol state machine (kcp.go) handling ARQ, retransmission, and congestion control, and a transport layer using raw UDP sockets. The data pipeline for outgoing packets is: App Write -> KCP Send -> KCP flush -> FEC Encode -> Encrypt -> UDP Socket. Incoming: UDP Socket -> Decrypt -> FEC Decode -> KCP Input -> App Read. Key features include: reliable ARQ with fast retransmit, Forward Error Correction (FEC) using Reed-Solomon codes, packet-level encryption (AES, TEA, Salsa20, etc., plus AEAD support), platform-specific optimizations (sendmmsg/recvmmsg on Linux), a global timer scheduler to avoid per-session goroutines, and a buffer pool to minimize GC pressure. The codebase demonstrates exceptional craftsmanship with hand-optimized CFB encryption (8x loop unrolling), a generic ring buffer with dynamic resizing, and an auto-tuning FEC decoder that adapts to peer parameters.

RATING: 9.3/10 MAINT: active DRIFT: low
▸ 3 reusable components found
pelletier/go-toml ★ 1980 250 APPLICATION

This repository provides a Go library (`github.com/pelletier/go-toml/v2`) for reading and writing TOML documents, conforming to TOML v1.1.0. It offers a two-phase architecture: a low-level iterative AST parser in the `unstable` package, and higher-level `Marshal`/`Unmarshal` functions with configurable streaming `Encoder`/`Decoder` that support strict mode, custom marshalers, and struct tags. The library is dependency-free (only standard library) and includes three CLI tools: `tomll` (formatter), `tomljson` (TOML to JSON), and `jsontoml` (JSON to TOML). The codebase demonstrates strong engineering practices: pooled encoder/decoder states, cached struct plans via `sync.Map`, word-at-a-time scanning for performance, a fused generic decode path, and comprehensive test coverage including auto-generated conformance tests from the upstream toml-test suite. It also includes an experimental document-editing package (`unstable/edit`) that preserves comments and layout via byte-range indexing and splice-based mutations.

RATING: 9.3/10 MAINT: active DRIFT: low
▸ 3 reusable components found
zombiezen/go-sqlite ★ 982 41 APPLICATION

zombiezen/go-sqlite is a Go library providing low-level bindings to SQLite 3 using the CGo-free modernc.org/sqlite implementation. It offers direct access to SQLite features including connection management, statement execution, blob I/O streaming, online backup API, user-defined functions (scalar and aggregate), session API for changesets, virtual table support, and schema migration tools. The architecture follows a modular design with core sqlite package for basic operations, sqlitex for extended utilities (connection pooling, execution helpers), sqlitefile for blob-backed buffers, and sqlitemigration for schema migrations. The library is safe for concurrent use through connection pooling and proper error handling, with comprehensive test coverage demonstrating its reliability.

RATING: 9.3/10 MAINT: active DRIFT: low
▸ 4 reusable components found
graph-gophers/graphql-go ★ 4761 496 APPLICATION

This is a production-grade GraphQL server library for Go. It parses GraphQL SDL into an AST, validates incoming queries against the schema, executes queries/mutations/subscriptions by binding Go structs and methods as resolvers, and supports introspection, tracing, and basic Apollo Federation. The public API centers on graphql.ParseSchema/MustParseSchema and Schema.Exec, with a relay.Handler for HTTP transport. Internally, the code is organized into focused packages for lexing, parsing, validation, execution, and tracing, with a clear separation between schema representation (ast), resolvable binding, and runtime execution. The library is not a service or data pipeline; it is a component meant to be embedded in Go HTTP servers, as demonstrated by the example/starwars, example/social, example/caching, and example/federation servers. Architecturally, the codebase is a well-structured library with minimal external dependencies beyond the Go standard library. Optional integrations exist for OpenTelemetry and OpenTracing, and the validation test corpus is derived from the graphql-js reference implementation. The execution engine uses reflection-based resolver binding, supports field selection inspection, memory pooling, and configurable validation limits. The repository is actively maintained, targets the September 2025 GraphQL spec, and includes extensive unit tests, fuzz tests, and benchmarks. Some deprecated APIs remain (e.g., the old trace package and DisableIntrospection), but they are clearly marked and superseded by modern equivalents. Overall, this is a mature, high-quality library with strong engineering practices and reusable internal patterns.

RATING: 9.2/10 MAINT: active DRIFT: low
▸ 5 reusable components found
cloudwego/netpoll ★ 4603 504 APPLICATION

Netpoll is a high-performance non-blocking I/O networking framework for Go, developed by ByteDance for RPC scenarios. It provides an event-loop server and dialer with zero-copy Reader/Writer APIs backed by a custom linked buffer (LinkBuffer). Under the hood, it uses epoll on Linux and kqueue on BSD, with an operator cache and a load-balanced poll manager. The architecture is a non-blocking reactor pattern: an event loop accepts connections, assigns them to pollers, and schedules OnRequest/OnConnect/OnDisconnect callbacks asynchronously via a goroutine pool. The library features connection health checking, idle timeout, and a connection reuse probe for client pools. It is production-ready and used by ByteDance's RPC framework Kitex and HTTP framework Hertz.

RATING: 9.2/10 MAINT: active DRIFT: low
▸ 5 reusable components found
ory/dockertest ★ 4525 269 APPLICATION

ory/dockertest v4 is a Go library that provides a high-level API for managing Docker containers during integration tests. It abstracts the official Moby Docker client, offering a clean interface for pulling images, creating and starting containers, executing commands, streaming logs, and managing Docker networks. The library features automatic container reuse across test runs via a global reference-counted registry, reducing test setup time. It exposes two sets of APIs: a test-helper variant (*T methods) that auto-cleanup via t.Cleanup, and a context-aware variant for non-test code. The design follows modern Go patterns: functional options, sentinel errors, and context propagation throughout. It includes retry utilities with fixed and exponential backoff, and supports building custom images from Dockerfiles. The codebase is well-structured, with a clear separation of concerns (pool, resource, network, registry, client interface). Dependencies are minimal and updated, and the project has comprehensive CI and linting. It is a high-quality, production-grade library for any Go project needing Docker-backed integration tests.

RATING: 9.2/10 MAINT: active DRIFT: low
▸ 3 reusable components found
tinylib/msgp ★ 1950 202 APPLICATION

This is the `tinylib/msgp` repository, a high-performance MessagePack serialization library for Go with an integrated code generation tool. The actual system consists of two layers: a runtime library in the `msgp/` package providing buffered readers/writers, zero-copy byte slice operations, and interfaces like `Marshaler`/`Unmarshaler`; and a code generator (`main.go`, `gen/`, `parse/`) that produces optimized, reflection-free serialization methods from Go structs and directives. The architecture is a combination of a CLI tool (for `//go:generate` workflows) and a library that the generated code depends on. Key entry points include the `Run()` function in `main.go` for code generation, and the `Reader`/`Writer` types for runtime I/O. External dependencies are minimal: `philhofer/fwd` for buffered I/O and `golang.org/x/tools` for code formatting. The library supports advanced features like shims, type replacement, omitempty/omitzero, limits, generics, and set types. The codebase is well-structured, with extensive tests and benchmarks, and demonstrates sophisticated engineering in code generation and serialization performance.

RATING: 9.2/10 MAINT: active DRIFT: low
▸ 3 reusable components found
projectdiscovery/cdncheck ★ 989 135 APPLICATION

cdncheck is a Go library and CLI tool for identifying whether an IP address or domain belongs to a CDN, WAF, or cloud provider. It uses embedded CIDR range data (compiled from ASN, URL, and static CIDR sources) and efficient IP matching via the `bart` radix tree. The library provides a clean `Client` interface with methods like `CheckCDN`, `CheckCloud`, `CheckWAF`, and `CheckDomainWithFallback` that also resolve DNS and check CNAME suffixes. The CLI wraps this with input/output handling, filtering, and JSON output. The codebase is well-structured, with clear separation between core logic, data generation, and CLI runner. It is actively maintained by ProjectDiscovery and used in their security scanning ecosystem.

RATING: 9.2/10 MAINT: active DRIFT: low
▸ 3 reusable components found
ikawaha/kagome ★ 982 60 APPLICATION

Kagome is a self-contained Japanese morphological analyzer written in pure Go. It provides tokenization with part-of-speech tagging, multiple segmentation modes (normal, search, extended), and dictionaries embedded in the binary for easy deployment. The system includes a CLI tool with subcommands (tokenize, server, lattice, sentence), a RESTful API server mode, WebAssembly support for browser use, and C library API for FFI integration with languages like Python and PHP. The architecture centers around a lattice-based Viterbi algorithm for tokenization, with clean separation between tokenizer logic, dictionary handling, filtering utilities, and interface layers.

RATING: 9.2/10 MAINT: active DRIFT: low
▸ 2 reusable components found
quic-go/webtransport-go ★ 512 87 APPLICATION

webtransport-go is a Go library implementing the WebTransport protocol over HTTP/3, based on quic-go. It provides both client and server functionality to establish WebTransport sessions over QUIC connections, supporting bidirectional and unidirectional streams, datagrams, and session flow control. The library follows draft-ietf-webtrans-http3-16 and includes mechanisms for capsule-based control messages, stream error mapping, and origin checking. It is used in production by projects like Centrifugo, go-libp2p, and MediaMTX. The architecture is modular, with separate components for session management, stream maps, flow control, and capsule parsing. The server integrates with http3.Server via ConfigureHTTP3Server and provides an Upgrade method on HTTP handlers. The client offers both one-shot Dial and multi-session NewClientConn. The codebase emphasizes correctness with extensive unit and integration tests, including tests for reordering, flow control, and error handling. Key design decisions include the use of goroutines for concurrent stream acceptance and capsule processing, channel-based notification for flow control updates, and careful handling of session close to ensure streams are properly terminated. The implementation handles edge cases like stream reordering before session establishment, deadline propagation, and graceful shutdown with configurable timeouts. The repository is well-maintained with active CI, linting, and dependency management. It demonstrates strong Go engineering practices with clean interfaces, proper error handling, and comprehensive test coverage.

RATING: 9.2/10 MAINT: active DRIFT: low
▸ 2 reusable components found
d2lang/d2 ★ 25564 758 APPLICATION

D2 is a declarative diagramming language and compiler implemented in Go. It parses a textual DSL, compiles to an intermediate representation, applies automatic layout via multiple engines (Dagre, ELK, and the custom TALA engine), and renders to SVG, PNG, PDF, PPTX, ASCII art, and animated GIF. The architecture is a pipeline: parser (d2parser) → compiler (d2compiler/d2ir) → graph (d2graph) → layout (d2layouts) → renderer (d2renderers). It also includes a language server (d2lsp) for IDE integration and JavaScript/WASM bindings for browser and Node.js usage. The codebase is production-grade with extensive testing, resource safety patterns (work guards, budgets, transactions), security hardening (SVG escaping, network policy), and a CI/CD release pipeline. External dependencies include Go modules for layout algorithms, bundled fonts, and Noto Color Emoji. The system is primarily a CLI tool and Go library, with a secondary JavaScript API.

RATING: 9.1/10 MAINT: active DRIFT: low
▸ 5 reusable components found
spf13/viper ★ 30438 2284 APPLICATION

Viper is a mature, widely-used Go configuration library that provides a unified API for reading configuration from multiple sources: files (YAML, JSON, TOML, dotenv), environment variables, command-line flags (via pflag), remote key-value stores (etcd, Consul, Firestore, NATS), and explicit overrides. It implements a priority-based merging system where later sources override earlier ones. The library offers nested key access with dot notation, aliasing, live file watching, and unmarshaling to structs via mapstructure. The architecture is a single Viper struct with internal maps for each source, plus a pluggable encoding layer and a finder interface for config file discovery. It is designed as a library to be embedded in Go applications, not as a standalone service.

RATING: 9.0/10 MAINT: maintained DRIFT: low
▸ 3 reusable components found
uber-go/zap ★ 24665 1570 APPLICATION

Uber-go/zap is a high-performance, structured logging library for Go. It provides two primary logger types: the zero-allocation, reflection-free Logger for hot-path usage and the ergonomic SugaredLogger for printf-style logging. The library emphasizes minimal allocations through object pooling, lazy field evaluation, and efficient encoders (JSON and console). It includes advanced features like sampling, dynamic level adjustment via AtomicLevel, hook systems for extensibility, and integration with testing, gRPC, and standard library. The architecture is modular, separating public API (zap), core implementation (zapcore), testing utilities (zaptest), and experimental features (exp).

RATING: 9.0/10 MAINT: active DRIFT: low
▸ 5 reusable components found
$ loading more...
$ submit: