Built for Zig 0.17.x · Zero hidden state

Go ergonomics.
Zig foundations.

A practical standard-library companion for Zig: native std.Io streams, explicit allocators and I/O, and familiar high-utility packages with zero C dependencies by default.

$ zig fetch --save git+https://github.com/jiacai2050/stdgo.git#v0.1.0
// Go-style duration, regex & URL parsing
const std = @import("std");
const stdgo = @import("stdgo");

pub fn main(init: std.process.Init) !void {
    const gpa = init.gpa;
    const timeout = try stdgo.time.parseDuration("1h30m");
    var re = try stdgo.regexp.compile(gpa, "https?://[^ ]+");
    defer re.deinit();

    const text = "Repo: https://github.com/jiacai2050/stdgo";
    const matched = re.findString(text) orelse return error.NotFound;
    const u = try stdgo.net.url.parse(matched);
    std.debug.print("{s}{s} ({d}s)\n", .{ u.host, u.path, timeout.seconds() });
}

API Reference

Choose a documentation build

Generated directly with zig build docs from the source tree.

Architecture

Built the Zig way

Go developer experience without sacrificing Zig's explicit control.

01

Explicit Injection

Every allocating or I/O API takes std.mem.Allocator and std.Io explicitly—no hidden globals or runtime shims.

02

Native 0.17 Streams

stdgo.io.Reader and Writer alias std.Io directly for zero-copy streaming across HTTP, compression, and archives.

03

Native Deadlines

Cooperative cancellation via std.Io.Future, CancelSource, and explicit Deadline values instead of opaque contexts.

04

Zero C by Default

Pure Zig implementations across the core suite, with optional -Dsqlite=true when you want the SQLite driver.

Package Ecosystem

Included modules

30+ top-level packages verified with comprehensive unit tests.

I/O, Files & OS

io io.fs bufio os path flag

Networking & Web

net net.http net.url net.mail net.textproto mime

Encoding & Formats

encoding.json encoding.csv encoding.xml encoding.base64 encoding.hex encoding.binary

Text & Templates

bytes strings strconv regexp unicode text.template html.template

Concurrency, Time & SQL

sync time database.sql log.slog expvar testing

Archives, Crypto & Binary

archive compress crypto hash image debug