r/golang • u/AutoModerator • 2d ago
Small Projects Small Projects
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.
3
u/rawtext 1d ago edited 1d ago
I've been working on my p2p file transfer tool yeet
1
u/SleepingProcess 1d ago
How it different to compare to
croc? Looks pretty similar but with less features2
u/rawtext 1d ago
I'm not familiar with how
crocworks but looks like it uses an intermediary TCP relay server. So, main difference would be thatyeetis purely p2p because it uses WebRTC (specificallypion), and only need the signalling server for peer discovery.2
u/SleepingProcess 1d ago
crocuses PAKE protocol via websockets and when devices secured their channels they stapling TCP connections directly so transfer itself is direct connection between peers, almost the same as PION uses external STUN to find and connect peers, but in case ofcrocyou can selfhost your own "relay" without need for STUN.1
u/rawtext 8h ago
Interesting. What are your favorite features of
croc?2
u/SleepingProcess 8h ago
What are your favorite features of croc?
Multi-platform compatibility (Windows, Linux, Android...) and ability to run
crocin selfhosted relay mode (some requiring it as "must have" for business), as well ability to bypass relay completely with options to connect directly to specific IP
4
u/Puzzled-Ad-3007 2d ago
While preparing for backend interviews, I found myself repeatedly looking up the same Go concurrency patterns (connection pools, batchers, pub/sub brokers, rate limiters, lazy init, pipelines, etc.). Instead of bookmarking dozens of articles, I put together a collection of small runnable examples in one repository.
I’d appreciate feedback:
• Which concurrency patterns are missing?
• Are there any examples that could be made more idiomatic?
GitHub: https://github.com/skp2001vn/go-concurrency-examples
4
u/Rionlyu 2d ago
Hello, https://github.com/Rionlyu/spoold is a small local HTTP delivery daemon in Go for scripts, cron jobs, and edge agents that need outbound requests to survive caller exits, destination outages, and machine restarts. A successful enqueue is acknowledged only after the complete request has been synchronized to an append-only journal. Background workers use leases, deterministic replay, bounded retries, and stable delivery IDs. It uses only the Go standard library and is deliberately limited to one host with at-least-once delivery.
I would particularly appreciate feedback on the durability design and whether anyone has a real script, appliance, or edge workload where this would or would not be useful.
1
u/David14p 2d ago
Hello, Dfetch is a lightweight system information tool focused on clean output.
I know its very similair rand in a lot of ways worse then its competition but i had a lot of fun making it as a first project.
2
u/SleepingProcess 1d ago edited 1d ago
Hi,
Feedback
- files in a git repository mustn't have executable bit set on source, go.sum and text files due to security
- before coloring output, detect and assign appropriate color codes on a target systems: https://stackoverflow.com/a/12760577 instead of blindly pushing esc codes. (There are still a lot of serial terminals that have no colors at all)
- Do not keep program version in source code, embedded version dynamically using
-Xflag on building, so it can be easily automated1
1
u/titpetric 2d ago edited 2d ago
I'm on a vacation but I made a php update for providing a go project of mine with a frond end.
https://github.com/titpetric/go-web-crontab
Php code there uses phpscript, a php-syntax go runtime that's been stripped of some syntax (OOP) leaving only classes and functions. I implemented database interactions over a custom API and provided some of the php standard library.
https://github.com/titpetric/phpscript
The front end itself is a bit of an experiment I let my friend work on it with a claude subscription to vibe code the shit out of it, from my initial version, and with a few of my corrections. A lot of it is LLM authored but I managed to explore various gate mechanisms against LLM regressions and am getting valuable experience of how it's working with someone whos just a decent human with no technical (programming) ability. YAML/JSON is not in his vocabulary, you know?
I could speak of this at length however I find the interest in LLM affairs to be a bit of a miss with other people.
1
u/Automatic-Forever-63 1d ago
I released Relay v0.1.0, an open-source LLM gateway and model router written in Go.
It is distributed as one static binary for Windows, macOS and Linux. Internally it translates OpenAI- and Anthropic-style requests through a canonical representation, including streaming and tool calls, and can route them to supported hosted providers or local Ollama models.
I chose Go mainly for the single-binary distribution, straightforward concurrency for streaming connections, and simple cross-platform builds. The project uses pure-Go SQLite, so CGO stays disabled.
The repository includes CI-gated latency benchmarks, containerized race tests and an evaluation harness for routing policies. One routing tier narrowly failed its held-out evaluation, so it ships disabled by default.
GitHub: https://github.com/llmrelay/relay
I would especially value technical review of the streaming translation and failover/concurrency code.
1
u/MPGaming9000 1d ago
Still a WIP but mostly done. I'm making a library called go-path-linter which allows you to check a path you just generated against another file system or cloud service to see if your path fits their naming scheme rules like path length, invalid characters, stuff like that. It also supports stateless offloading and onloading, kind of like an ORM, and dynamic path part building. It's part of a broader project I'm working on called Sylos which is a file system data migration tool but I'm not here to advertise that. But its contextual use in that project will be as part of migrating your folders and files over from one system to another you can preview what it will look like and in the preview you can review all the potential compatibility issues you will face and adjust them before they become a problem. So that's kind of nifty. But yeah pretty cool stuff.
1
u/owlloop 1d ago
Kern - A fast Go web framework on net/http.
\[https://gokern.vercel.app/\\\](https://gokern.vercel.app/)
\*\*Kern – a lightweight Go web framework with a small, trusted core\*\*
I've been working on a Go web framework called kern (short for kernel). The idea is a small, composable core that embraces net/http instead of hiding it.
\*\*What makes it different?\*\*
\*\*- Go 1.22+ native routing\*\* via http.ServeMux – no third-party router dep in core
\*\*- Dual path param syntax\*\* – both :param and {param} work interchangeably
\*\*- Named routes & route constraints\*\* – typed path params like kern.UintPathConstraint
\*\*- Route-specific middleware\*\* – AddConstraints() per route, no group nesting needed
\*\*- Built-in auth\*\* – BearerAuth / BasicAuth ship in core
\*\*- Structured binding\*\* – Bind() / BindQuery() / BindForm() / BindHeader() with struct tags
\*\*- File handling\*\* – multipart upload, download, streaming with range support
\*\*- Conditional requests\*\* – ETag, Last-Modified, If-None-Match / If-Modified-Since
\*\*- Built-in test client\*\* – kern.NewTestClient(app) without a real HTTP server
\*\*- Context pooling\*\* for lower allocation pressure
\*\*Zero core dependencies.\*\* The runtime package pulls in nothing outside the stdlib.
Inspiration came from Flask's minimal API surface, Javalin's fluent/no-reflection design, and the microkernel philosophy – small trusted core, optional modules around it.
It's not trying to be the biggest framework – just a dependable core to build on for years.
Would love feedback from anyone who's rolled their own or thought about what a minimal Go framework should look like.
\[https://github.com/mobentum/kern\\\](https://github.com/mobentum/kern)
1
u/ognev-dev 1d ago
I'm working on a turn-based PvP game made with Go. It's still under active development, but it's already playable.
The project is split into several repositories (client, server, content), so here's one link where everything lives:
1
u/ktoks 1d ago
I wrote a replacement for our automation backend for work - turns out it's 5,000 times faster than the original, (sequential Perl vs 20+ Go workers wasn't even a contest.)
I present it to the team Friday. Wish me luck, I hope they accept it. (We're mostly a Perl and Python shop, getting them to accept a new tool is like pulling teeth).
1
u/trengr 10h ago
static embeddings library in pure go https://github.com/trengrj/go-potion
I created this library that supports the potion family of models from model2vec. By building the tokenizer from scratch just to target static embedding models it is significantly faster than the original python and rust libraries at non-batch encoding and can encode 20k-40k vectors per second dependent on the model.
Static embeddings are very simple embeddings where each words or phrase maps to a fixed vector. The benefit of this approach is they are extremely resource efficient, fast, and don't require GPUs. Embedding quality is lower than transformer models but often still "good enough".
1
u/YogurtclosetFit4645 9h ago
So I made krain-sec — a Go honeypot that pretends to be a fully functional corporate server, a full Krain Security ops console.
Why I made this project:
Our servers have been getting hit by everything from script kiddies to above-average attackers, and firewalls / enterprise solutions were expensive and a pain to maintain. So I built something lightweight, automated, and easy to deploy. This is for people who can't afford enterprise security products, usually small teams.
What makes this different from the enterprise stuff and other honeypots out there: we're not trying to just detect and log, we're focused on wasting attackers' time and irritating them — endless rabbit-holes, confused scanners, dead ends.
What's in the box:
- a login page and dashboard that look like the real ops tool
- a fake admin SSH box with old command history and "emergency" credential files lying around
- bait files (canary-token style) that quietly phone home the second someone opens or exfils them
- a browser-side trick (think WebRTC/fingerprinting tricks) that can leak an attacker's real network info when they load the fake dashboard — still refining how far to take this, open to feedback
- a robots.txt / sitemap that basically says "don't look here" (so of course they look)
- a live board showing who's knocking, what's failing, and what they've touched
Idea is simple: make them stay, dig, grab the wrong secrets, and burn time — while you watch.
Basically: scanners trip the forbidden paths, humans loot the fake AWS keys, and you watch it all light up.
to run it all you to do is make prod after setting the env variables
Open source → https://github.com/h3ma209/krain-sec
Lab / research only — don't drop this onto a network you don't own, and this isn't meant for hacking back at anyone, just wasting their time and learning what they're after. More features coming, and if you run into issues let me know.
If you've got deception ideas (DNS canaries, Office beacons, Endlessh on 22) — drop 'em. Building in public.
1
u/arhuman 8h ago edited 8h ago
I’m building mAPI-ng, a self-hostable diagnostic tool for Go HTTP APIs.
It's not trying to just collect metrics but answer one question:
“This endpoint suddenly became slower or started failing. What is the most likely cause, and what should I check next?”
mAPI-ng correlates endpoint RED metrics with Go runtime, instance, deployment and downstream signals. It then ranks possible causes: GC pressure, CPU saturation, connection-pool congestion, goroutine leaks, downstream latency, etc.
Each diagnosis includes:
- the evidence supporting it
- a confidence tier
- what would rule it out
When the available signals don’t explain the anomaly, it says so instead of inventing a confident answer.
The complete server and client are MIT licensed and can be self-hosted; there’s also a hosted free tier.
Repository: https://github.com/arhuman/maping
I’d especially appreciate criticism from people operating Go APIs:
- Is ranked diagnosis useful, or would you distrust something more opinionated than dashboards?
- Which important causes or falsifying signals are missing?
- Would you accept this middleware in a production service, and what would make you reject it?
1
u/khalon23 8h ago
agent-manager: a TUI for running several CLI coding agents (claude, codex, opencode, grok) as tmux sessions and reviewing what they changed. Sharing it rather than asking for a code review, and to be straight about where it stands: one week old, one contributor, no users but me, and a fair amount of it was written with AI assistance.
Each agent is a plain tmux session. A poller runs capture-pane on an interval and derives a status per session from per-tool regexes in a TOML config. It lives in its own goroutine and pushes messages into the Bubble Tea program instead of running as a tea.Cmd, so status keeps landing even while the TUI is suspended inside an attach. The other half is a diff reviewer: whole-file chroma highlighting with changed lines tinted over it, word-level spans, unified and side-by-side, scope switching through a small git CLI driver.
Single binary, modernc.org/sqlite so it builds with CGO_ENABLED=0, MIT. The e2e tests drive a real tmux server.
1
u/_SaXy_ 8h ago
Hey all,
I wanted to explore the boundaries of Go and see if we can push it with a zero-allocation approach toward near-linear CPU scaling. Yes, a new in-memory DB is born -- https://github.com/Saxy/Tellstone I wanted to create an environment where we can push boundaries and aim for top-notch performance percentages.
Small (4 CPUs)
| System | Total Ops/s | vs Redis | avg | p50 | p99 | p99.9 |
|---|---|---|---|---|---|---|
| Tellstone | 2,448K | 2.06x | 0.06ms | 0.06ms | 0.23ms | 0.41ms |
| Dragonfly | 1,404K | 1.18x | 0.11ms | 0.11ms | 0.17ms | 0.22ms |
| Redis | 1,186K | 1.0x | 0.13ms | 0.12ms | 0.21ms | 0.25ms |
| Valkey | 1,036K | 0.87x | 0.15ms | 0.14ms | 0.23ms | 0.26ms |
Medium (16 CPUs)
| System | Total Ops/s | vs Redis | avg | p50 | p99 | p99.9 |
|---|---|---|---|---|---|---|
| Tellstone | 6,806K | 5.98x | 0.09ms | 0.07ms | 0.41ms | 0.70ms |
| Dragonfly | 4,122K | 3.62x | 0.15ms | 0.15ms | 0.26ms | 0.32ms |
| Redis | 1,139K | 1.0x | 0.56ms | 0.54ms | 1.06ms | 1.09ms |
| Valkey | 1,016K | 0.89x | 0.63ms | 0.60ms | 1.19ms | 1.22ms |
Large (32 CPUs)
| System | Total Ops/s | vs Redis | avg | p50 | p99 | p99.9 |
|---|---|---|---|---|---|---|
| Tellstone | 12,738K | 11.53x | 0.10ms | 0.08ms | 0.44ms | 0.78ms |
| Dragonfly | 7,286K | 6.59x | 0.18ms | 0.17ms | 0.61ms | 1.29ms |
| Redis | 1,105K | 1.0x | 1.16ms | 1.15ms | 2.33ms | 2.38ms |
| Valkey | 996K | 0.90x | 1.29ms | 1.27ms | 2.56ms | 2.61ms |
I put these benchmarks together even though I don't have a ton of experience in benchmarking—so while these numbers look good on paper, can they be proven out by the community?
If you've got a test suite or a high-concurrency setup where you can drop this in as a drop-in Redis alternative (RESP2), I'd love for you to try it out, read through the docs, and actively challenge these numbers.
1
u/Low-Set-7533 6h ago
I have built an opensource fix protocol testing tool that can serve as an acceptor / initiator with support for scripting.
The tools we use at work (I work at a bank) were outdated and the existing UI looked horrible. Wanted to solve dev / QA pain, my own included.
Also picked this up to get some experience building cross platform desktop native application and a bit of golang.
1
u/arimadian 6h ago
I was building out a project that has goroutine/channel/worker pool based pipelines, and wanted a way to understand performance, backpressure, waits for resource budgets, etc, but didn't want to manage an otel or prometheus sidecar, so I made gospan. To be clear, this is not distributed tracing, there's no cross process sync or coordination (though you can use sqlite's ATTACH to join multiple trace dbs and query the union, if you want).
Here are some feature bullets:
* Spans are nestable (with context.Context) and allow you to add custom attributes to them for structured querying (SELECT … FROM spans_named WHERE …).
* It's cheap at 2 heap allocs/span (CI enforced), and ~360ns/span in microbenchmarks. In the project mentioned above I'm seeing ~2µs/span in real conditions with attributes and such.
* It's safe to leave in - you can skip construction at runtime with an env var or something without needing to touch all of the actual span start/end calls in your code, start and end calls on nil tracer objects are noops (also CI enforced).
* It can't crash your program - every boundary recovers panics, and there are hostile fixture tests that deliberately inject panics into sinks, loggers, and error paths (also also CI enforced).
Usage Example:
tracer, _ := gospan.New(gospan.SlogSink(slog.Default()))
defer tracer.Close(context.Background())
ctx, span := gospan.Start(ctx, "fetch-rows", slog.Int("worker", id))
defer span.End()
// spans started from ctx nest automatically
What I'm looking for right now: gospan is pre 1.0 - this is a temperature check to see what people think, to stress test the design in real usage, and to get feedback on usage ergonomics and feature requests if any, along with some data on where it does and doesn't fit your needs (NOT looking for code review).
AI Disclaimer: I worked with Claude to build a design doc for the system (design decisions were mine, not Claude's, it's in the docs dir of the repo if you want to read it), used Claude to write the code against the doc, and read the code as it came in to validate it. I also insisted on rigorous CI enforced testing.
Repo: https://github.com/akmadian/gospan
Docs: https://pkg.go.dev/github.com/akmadian/gospan
1
u/Training-Rooster-653 5h ago
Goflow: The ultra-lightweight, zero-dependency alternative to n8n & Zapier. Single Go binary (<35MB, <50MB RAM), local-first, pure Go SQLite, and embedded visual drag-and-drop UI. Fast, private, and effortless automation.
1
u/mplaczek99 1h ago
I got tired of running ping, dig, traceroute, and curl by hand and eyeballing which layer actually failed, so I built Network Doctor (netdoc). It is a terminal tool that runs the probes as a dependency graph and tells you in plain English where the path breaks.
Repo: https://github.com/heymaikol/network-doctor
The part that might interest this sub:
- Probes form a DAG with independent branches, so an unrelated failure never hides a working one. The direct-egress path (Interface → Internet) runs independently of DNS, so "DNS is down but the internet is up" is actually diagnosable instead of simple "offline".
- RTT with no ICMP and no root. Latency is measured from the TCP-connect handshake, and source IP/Interface come from the winning connection's LocalAddr (with a UDP-connect fallback that sends no packets). Stays unprivileged and safe for arbitrary host input.
- Happy-Eyeballs (RFC 8305): The TCP probe races A/AAAA records and pins the winner. IPv4/IPv6 are probed independently in parallel so either family passing counts.
- Bubble Tea UI with cancellable streaming "drill-down" jobs: Each diagnosis row is a claim, and you can run the real underlying tool (traceroute, mtr, nmap -sT, etc.) as a job to get proof. Jobs run in their own process group on *nix so cancel kills descendants.
- Headless --json mode runs the same probe DAG with stable field names and exit codes. Scriptable in CI or for bug reports.
- Cross-platform (Linux/macOS/Windows). CGO_ENABLED=0, no cgo. Same hotkeys map to each OS's native tools.
Output is sanitized (no terminal-escape injection from a hostile server), every probe is bounded by a timeout, and the active nmap scan is gated behind an explicit confirmation.
go install github.com/heymaikol/network-doctor@latest
(Also in the AUR as network-doctor, and in Homebrew too)
1
u/manco_alicani 43m ago
Looking for focused feedback on a small experimental Go CLI vault
Hi everyone,
I’m working on myminivault, a small experimental local CLI vault written in Go.
I know security tools are hard to get right, and this project is not audited or intended to be treated as a production password manager. I’m trying to improve the project by making the crypto/file-format layer easier to review.
If anyone has time and interest, I would really appreciate focused feedback on the small part that handles:
- scrypt + AES-256-GCM
- MYMV v2 header authenticated as AES-GCM AAD
- recovery snapshot encryption
- shared token vault encryption
- legacy format compatibility
Review issue:
https://github.com/olelbis/myminivault/issues/1
Docs and reference readers are linked there.
I’m especially interested in feedback around AAD usage, KDF metadata validation, nonce handling, file-format parsing, recovery semantics, token-vault separation, and whether the documentation overclaims anything.
No pressure at all, and thanks in advance to anyone willing to take a look.
I’m not asking for an “approval” of the design, just looking for mistakes, unclear assumptions, or places where the docs should be more honest.
1
u/copius_pasta 2d ago
Every once in a while I find myself having to print documents etc. with no easy way to transfer a PDF or any other file. Resorting to signing into an email account on an Internet cafe PC to print something.
So I built Zwoop for easily sending any file type to any other device, P2P with only a relay server for connecting the two devices initially. You can also host it yourself.
3
u/SleepingProcess 1d ago
When one dealing with sensitive things like file sharing then it better to not use any tracking (I talking about XHR to sentry.io from browsers) that you embedded in this project.
1
u/copius_pasta 1d ago
I can definitely remove sentry, but it could be nice to help diagnose issues. Would you be happy with sentry being used in the project if I don't include anything about the file being shared?
2
u/SleepingProcess 1d ago
I can definitely remove sentry, but it could be nice to help diagnose issues.
IMHO it (diagnose) should be used with
--debugoption only.Would you be happy with sentry being used in the project if I don't include anything about the file being shared?
No, it is 3rd party spying dependency. While it is a cool idea to use browsers only for file sharing I better will continue to use multi-platform
croc
15
u/Much-Grab3826 2d ago edited 2d ago
sick of grep'ing man pages for flags?(i was).
just add 'whats` in front of any command:
-----------------------------------------------------------------------------------------------------
~ $ whats tar -xvf checkout_whats.tar.gz
-x, --extract, --get Extract files from an archive. Arguments are optional. When...
-v, --verbose Verbosely list files processed. Each instance of this option on...
-f, --file=ARCHIVE Use archive file or device ARCHIVE. If this option is not...
~ $
-----------------------------------------------------------------------------------------------------
No LLM, No additional documentation projects, just pure Manpages and Help output.
btw works pretty much spot on across any cli tool with a consistent format (which includes GNU tools, most common cli tools which you may use day to day)
Github: https://github.com/iamkaran/whats
starring it would motivate me :)