r/golang • • 5d ago

Small Projects Small Projects

23 Upvotes

This is the weekly thread for Small Projects.

The point of this thread is to have looser posting standards than the main board. As such, projects are pretty much only removed from here by the mods for being completely unrelated to Go. However, Reddit often labels posts full of links as being spam, even when they are perfectly sensible things like links to projects, godocs, and an example. r/golang mods are not the ones removing things from this thread and we will allow them as we see the removals.

Please also avoid posts like "why", "we've got a dozen of those", "that looks like AI slop", etc. This the place to put any project people feel like sharing without worrying about those criteria.


r/golang • • 4d ago

Jobs Who's Hiring

31 Upvotes

This is a monthly recurring post. Clicking the flair will allow you to see all previous posts.

Please adhere to the following rules when posting:

Rules for individuals:

  • Don't create top-level comments; those are for employers.
  • Feel free to reply to top-level comments with on-topic questions.
  • Meta-discussion should be reserved for the distinguished mod comment.

Rules for employers:

  • To make a top-level comment you must be hiring directly, or a focused third party recruiter with specific jobs with named companies in hand. No recruiter fishing for contacts please.
  • The job must be currently open. It is permitted to post in multiple months if the position is still open, especially if you posted towards the end of the previous month.
  • The job must involve working with Go on a regular basis, even if not 100% of the time.
  • One top-level comment per employer. If you have multiple job openings, please consolidate their descriptions or mention them in replies to your own top-level comment.
  • Please base your comment on the following template:

COMPANY: [Company name; ideally link to your company's website or careers page.]

TYPE: [Full time, part time, internship, contract, etc.]

DESCRIPTION: [What does your team/company do, and what are you using Go for? How much experience are you seeking and what seniority levels are you hiring for? The more details the better.]

LOCATION: [Where are your office or offices located? If your workplace language isn't English-speaking, please specify it.]

ESTIMATED COMPENSATION: [Please attempt to provide at least a rough expectation of wages/salary.If you can't state a number for compensation, omit this field. Do not just say "competitive". Everyone says their compensation is "competitive".If you are listing several positions in the "Description" field above, then feel free to include this information inline above, and put "See above" in this field.If compensation is expected to be offset by other benefits, then please include that information here as well.]

REMOTE: [Do you offer the option of working remotely? If so, do you require employees to live in certain areas or time zones?]

VISA: [Does your company sponsor visas?]

CONTACT: [How can someone get in touch with you?]


r/golang • • 7h ago

show & tell gvx: Run Linux containers inside a single unprivileged Go process using gVisor's Sentry kernel (macOS, Windows, Linux, Android)

43 Upvotes

GitHub: https://github.com/gfire-sigs/gvx

Hi Gophers! We created gvx to execute Linux containers on macOS, Windows, Linux, and Android inside an unprivileged process. It runs gVisor's Sentry application kernel in userspace!

It supports standard OCI containers, dind, and local k3s clusters, and provides a docker cli-style standalone CLI (rungvx), an embeddable Go library, and a desktop GUI for macOS and Windows https://github.com/ironpark/gvx-desktop . We paid special attention to minimizing drift from gVisor and designed the architecture for easy maintenance while tracking upstream.

Any feedback is welcome!


r/golang • • 2h ago

Looking for used copies of Learning Go (2nd Ed) & Programming Kubernetes

0 Upvotes

Hi everyone,

​I'm based in europe and looking to buy second-hand physical copies of these two books if anyone in the EU has them sitting on a shelf:

​Learning Go (2nd Edition) – Jon Bodner

​Programming Kubernetes – Michael Hausenblas & Stefan Schimanski

​I'm happy to cover shipping within Europe


r/golang • • 9h ago

help Is my worker shutdown with context correct?

0 Upvotes

I built GoFlow, a job queue in Go. Apps send jobs, it saves them in PostgreSQL, and workers run them.

When the app stops, `ctx` stops new jobs. Running jobs use `runCtx`, so they can keep running until the timeout. After the timeout, the worker cancels `runCtx` and the jobs stop.

```go

func (w *Worker) Run(ctx context.Context) error {

if len(w.handlers) == 0 {

	return errors.New("worker: no handlers registered")

}

w.log.Info("worker started", "concurrency", w.cfg.Concurrency, "types", w.Types())



runCtx, stopJobs := context.WithCancelCause(context.Background())

defer stopJobs(nil)



jobs := make(chan job.Job)

slotFreed := make(chan struct{}, w.cfg.Concurrency)



var executors sync.WaitGroup

for i := 0; i < w.cfg.Concurrency; i++ {

	executors.Add(1)

	go func() {

		defer executors.Done()

		for j := range jobs {

w.execute(runCtx, j)

select {

case slotFreed <- struct{}{}:

default:

}

		}

	}()

}



var background sync.WaitGroup

heartbeatCtx, stopHeartbeat := context.WithCancel(context.Background())

background.Add(2)

go func() { defer background.Done(); w.heartbeatLoop(heartbeatCtx) }()

go func() { defer background.Done(); w.reapLoop(ctx) }()



w.fetchLoop(ctx, jobs, slotFreed)

close(jobs)



drained := make(chan struct{})

go func() { executors.Wait(); close(drained) }()



select {

case <-drained:

case <-time.After(w.cfg.ShutdownTimeout):

	stopJobs(errShutdown)

	<-drained

}



stopHeartbeat()

background.Wait()

return nil

}

```

My questions:

  1. I made `runCtx` from `context.Background()`. Is that okay, or is `context.WithoutCancel(ctx)` better?
  2. After the timeout, if a job ignores the cancel, shutdown waits forever. Should I add a second timeout?

Code: https://github.com/webdomain0126/goflow


r/golang • • 9h ago

show & tell I built failnext, a Go library for client-side HTTP failover

0 Upvotes

I wanted my Go app to try a backup HTTP endpoint when the primary couldn't handle a request. I didn't want to run a separate proxy just to handle failover.

A 503 is easy to handle. But HTTP 200 doesn't always mean the app got the data it needed. The primary might return an application-level error because its data is too stale, while the backup might have newer data.

The primary might also not respond at all. It can hang until the request deadline expires, leaving no time to try a backup.

So I built failnext, a Go library for client-side HTTP failover with no external dependencies. It implements http.RoundTripper, so it works with Go's standard http.Client. It's designed for a small, priority-ordered set of providers, typically a primary and several backups.

I originally built it for go-ethereum over HTTP JSON-RPC, but the library itself is protocol-neutral.

Here's what failnext can do:

  • Primary unavailable? Try the next provider.
  • Primary hangs? Set a per-attempt timeout to leave time for a backup.
  • HTTP 200 with an application-level error? Your app can retry with that provider excluded.
  • Provider is stale or degraded? If your app detects it, failnext can skip it.
  • Want reads to fail over, but not writes? Your app can allow failover for reads and block it for writes.
  • Reading after a write? Try the provider that handled the write first.
  • Everything failed? See which providers were tried and what went wrong.

I wanted failnext to handle provider selection, cooldowns, and HTTP-level failover. It doesn't inspect response bodies or detect lagging providers.

The app can use context helpers to control whether a request can fail over, which providers to exclude, and which one to try first. The OnEvent callback reports which providers were tried and which one returned the final response.

I'd be interested in feedback on the RoundTripper approach and any failover cases I might have missed. If you try failnext, let me know what doesn't work or feels awkward.

GitHub: https://github.com/yermakovsa/failnext


r/golang • • 1d ago

show & tell Post-Quantum Cryptography, Explained in Go

Thumbnail
youtu.be
18 Upvotes

r/golang • • 1d ago

show & tell I made a goroutine dump reader that groups 5,000 goroutines into a few lines and flags leaks (runs in the browser)

Thumbnail
threadline-be-fast.vercel.app
26 Upvotes

When a Go service hangs or slowly eats memory, I grab /debug/pprof/goroutine?debug=2 and then scroll through thousands of nearly identical stacks trying to spot the pattern. So I built a page that does the scrolling for me:

https://threadline-be-fast.vercel.app/goroutine-dump/

Paste a dump (pprof debug=2, kill -QUIT output, a panic, or debug=1) and it:

  • groups goroutines by state and stack, so 312 leaked workers become one line: 312× chan send · main.queryDatabase (handlers.go:41)
  • flags common problems:

    • many goroutines stuck sending on one line (the classic leak after the caller gave up on ctx.Done())
    • wg.Wait() called before anyone reads the results
    • lock queues
    • readers stuck behind an RWMutex writer
    • nil channels
    • all goroutines are asleep and the other crashes

It all runs in the browser, so the dump never leaves your machine. Open the Network tab and check.

If you have a dump shape it gets wrong, or a pattern you hunt for by hand that it should flag, I'd love to hear it.


r/golang • • 18h ago

show & tell Checking 503 million keys without storing the expected answers: a Go stress harness for a key-value database on S3

0 Upvotes

We stress tested IsleDB, a key-value database in Go on object storage, at 1 TiB and 503 million keys, without storing the expected answers. The harness computes them:

The workload is a pure function. A hash of the round and the key index says whether that round wrote the key, so any key's history can be recomputed.

Keys come from a Feistel permutation instead of a hash. They land at random places, but the permutation can be reversed, so a scan can be checked for missing keys.

The only thing recorded is the revision each batch committed at. One number per batch.

https://ankuranand.com/blog/2026/12/05/checking-503-million-keys-in-a-1-tib-key-value-database-on-s3/


r/golang • • 15h ago

Only Rust, Go, and C++ Will Survive. Burn the Rest.

Thumbnail
programmers.fyi
0 Upvotes

r/golang • • 2d ago

Go 1.27.5 and Go 1.26.12 pre-announcement (2026-12-08)

Thumbnail groups.google.com
97 Upvotes

r/golang • • 2d ago

help Context cancellation vs explicit job states in a distributed worker pool — how do you draw the line?

7 Upvotes

We've been running a Go-based task queue for about a year and I keep going back and forth on where to draw the boundary between context cancellation and our own job-state machine. Early on we passed a context with timeout straight from the dispatcher into each worker, which felt idiomatic, but then retries made it messy: the context was already cancelled by the time we wanted to re-enqueue, so the state transition had to happen in the parent goroutine anyway. What we've settled on is using context purely for in-flight cancellation signals (worker shutdown, user-initiated abort) and letting the job's lease/heartbeat in our store own timeouts and retries, so the context never outlives a single execution attempt. Curious whether others hit the same split or just lean fully on context everywhere and handle the retry bookkeeping differently.


r/golang • • 3d ago

Laravel coming to Go

Thumbnail golang.laravel.cloud
213 Upvotes

Looks like a Go version of the framework is in the works!

EDIT: https://laravel.com/go


r/golang • • 2d ago

Serving both a live loopback dashboard and a standalone offline HTML snapshot from one ~110 KB Go html/template (zero npm, zero external deps)

2 Upvotes

While building a local CLI companion (agy-hq, pure Go stdlib with zero external requires in go.mod), I hit a classic UI duplication problem: I needed a live interactive dashboard on 127.0.0.1:4242 (net/http), and a self-contained single-file HTML snapshot that works offline on mobile without network access.

My first attempt maintained two separate renderers: internal/webui/assets/console.html for 127.0.0.1:4242, plus an 841-line Go adapter (console_space.go) just to emit the static offline HTML. Every new card or metric landed on the live page first and broke parity on the static export.

I ended up deleting all 841 lines of console_space.go (commit 2a03953) and unifying both behind one ~110 KB embedded console.html template toggled by a single StaticMode bool:

  • One state loader (loadState / RenderStaticConsoleHTML): Both the live /api/state JSON endpoint (internal/webui/webui.go) and offline SSR exports read the exact same Go structs and share the same exclusion boundary keeping sensitive private/ fields out of HTML/JSON.
  • Zero-dependency SSR + inline bootstrap hydration: When StaticMode is true, Go renders all five tabs into static HTML and embeds compact chart/search state inside <script id="hq-bootstrap-state"> via template.JS so tabs, accordions, SVG charts, and search filters run offline with zero external requests.
  • Graceful write degradation: In live mode, mutating POST routes enforce loopback Host validation, same-origin checks, and per-page CSRF tokens (plus a --read-only / --no-heartbeat flag in cmd/hq/ops_cli.go that rejects all non-GET/HEAD/OPTIONS requests with 403). In StaticMode, action buttons copy the exact CLI command with its SHA-256 digest to the clipboard instead of firing dead fetch() calls.
  • 5-second full JSON polling over WebSockets: Rebuilding dynamic DOM sections every 5s while snapshotting/restoring open <details> elements and keeping <input> search bars outside replaced containers survived laptop sleep/wake cleanly with zero websocket reconnect machinery.

Repo (Apache 2.0, zero external Go deps):

Curious how other Go CLI authors handle local web UIs without pulling in a Node/Vite build pipeline—especially around keeping static exports and live SSR in sync?


r/golang • • 3d ago

Comparing Laravel Go and Arkoren

Thumbnail
arkoren.dev
35 Upvotes

r/golang • • 3d ago

show & tell How Go’s Garbage Collector Works

Thumbnail
youtu.be
36 Upvotes

r/golang • • 3d ago

discussion Laravel just shipped a full-stack Rust framework. Why not Go?

176 Upvotes

Laravel just announced "Laravel Rust" - a full reimagining of the framework in Rust on Tokio/ Axum. Same batteries-included philosophy: routing, typed models, queues, workflows, auth, Inertia. Their pitch: 18x throughput vs PHP, 8x less memory.

Why Rust and not Go? Go seems like the more natural fit - simpler, faster compiles, great concurrency, lower barrier for the PHP crowd. Laravel's founder said Al agents helped write it in ~2 months, and framed Rust's compiler as a "guardrail" for Al-generated code.

Questions:

  1. Was Rust the right call over Go for a high-DX, batteries-included framework?
  2. Does Go's simplicity hurt it in the Al-coding era, where stricter compilers act as guardrails?

UPDATE : now they added laravel GO : https://laravel.com/go


r/golang • • 2d ago

Go's map does not shrink

0 Upvotes

r/golang • • 2d ago

Why does go get so much hate? Let's discuss

0 Upvotes

Go's simplicity is great for large projects, but it might feel limiting for those seeking more complex features. What are your thoughts?


r/golang • • 4d ago

discussion Release 0.45.0 · tinygo-org/tinygo

Thumbnail
github.com
66 Upvotes

sweet sassy molassy. If your code didn't run on tinygo before, try it now.

EDIT: blog post about the release: https://tinygo.org/blog/2026/tinygo-0.45-reflect-on-this/


r/golang • • 3d ago

help Discovered our internal API client library had been silently swallowing context cancellation for a year

3 Upvotes

We wrap every call in a helper that does `select { case <-ctx.Done(): return ctx.Err() case res := <-ch: return res }`, but the helper that built the channel never checked ctx in the underlying HTTP call, so canceled contexts were just racing the request to completion. The fix was passing ctx into http.NewRequestWithContext everywhere, which we should have done from day one, plus a lint check for `http.NewRequest(` to catch the legacy ones. What surprised me is how long it went unnoticed: everything "worked", just with slower cancellation and goroutines hanging around under load until timeouts fired. Anyone else inherited a shared client lib where ctx plumbing degraded gradually as new endpoints got bolted on?


r/golang • • 4d ago

show & tell An introduction to eBPF with Go

Thumbnail dayio.dev
103 Upvotes

Hi everyone,

I'm currently writing a short series on eBPF with Go, starting with this introductory post. In the next parts, I'll build a simple Docker system monitor to dive into more practical use cases.

If you enjoy low-level projects, I also wrote a series on decoding raw GPS signals from scratch using an RTL SDR and Go.

Feedback and thoughts are welcome. Have a nice day !


r/golang • • 4d ago

Looking for study buddy

39 Upvotes

I am an unemployed backend Golang developer, with 6+ years of experience in Go, previously 9 yoe in Java. Currently I am studying for interviews as a senior Go developer.

Looking for a similar unemployed Golang developer, to do mock interviews and pair programming sessions. The goal is to prepare for interviews. Write me a DM if you are interested.

P.S.: Sorry if this is not the right forum for this.


r/golang • • 4d ago

help Coming from Python: defer made my cleanup easier but I shot myself in the foot with it in a loop

77 Upvotes

After years of Python (I even taught a workshop on it at work), I finally got to write a real service in Go. I was processing files in a loop and used defer file.Close() inside the loop, then wondered why memory kept climbing on large batches — all those handles were staying open until the function returned, not each iteration. The fix was extracting the body into a helper function so defer fired per iteration, which is now obvious in hindsight. Lesson learned: defer is scoped to the function, not the block. Curious if others hit this their first month, or is it just me?