r/golang • • 10h ago

Jobs Who's Hiring

14 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 • • 1d ago

Small Projects Small Projects

17 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 • • 13h ago

Looking for study buddy

20 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 • • 13h ago

show & tell An introduction to eBPF with Go

Thumbnail dayio.dev
56 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 • • 1d ago

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

58 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?


r/golang • • 1d ago

show & tell Go Interactive Practice: Classic challenges, package deep-dives, and Go release breakdowns (Open Source)

Thumbnail
github.com
15 Upvotes

r/golang • • 1d ago

show & tell API Gateway for AI Agents

0 Upvotes

I build API Gateway for AI Agents https://github.com/Clivern/Sloth. It is using A2A protocol. check it out and let me know what do you think


r/golang • • 1d ago

show & tell sgh: a Go CLI that fans GitHub operations out across every repo in an org

2 Upvotes

I've been building sgh, a CLI for org-wide GitHub operations: branches, tags, PRs, Actions runs and branch protection. The official gh works one repository at a time; this one takes an org and runs against all of its repos. I'm the author, and it's MIT licensed.

sgh branch create --org my-org --new Release-2.0 --ref main --dry-run
sgh workflow list --org my-org --failed --branch main
sgh protected-branch list --org my-org --branch main

The parts that might interest this sub:

  • A shared worker pool does the fan-out, with a configurable worker count.
  • Rate-limit tracking, exponential backoff and a circuit breaker sit around the GitHub API calls.
  • Tokens are stored per owner in the OS keyring, with a plaintext fallback and a warning when no keyring exists.
  • Output is table, compact or JSON, and there is a Bubble Tea TUI.
  • Test coverage is 93%, enforced in CI with an 85% floor.

Code: https://github.com/pradyb/sgh-cli

Docs: https://pkg.go.dev/github.com/pradyb/sgh-cli

I'd appreciate a review of the concurrency and error-handling design, and any criticism of the package layout.


r/golang • • 1d ago

What's coming in Go

Thumbnail
go.antonz.org
67 Upvotes

r/golang • • 1d ago

Amazon

Thumbnail link.amazon
0 Upvotes

What's your opinion on this book in particular, and a functional approach to Go in general? I discarded the book after reading one and a half chapter like 7 years ago. But I've been almost exclusively doing functional programming* on my last contracts (even wrote a book on it :P), and picking the book up again recently makes me want to explore it further (in Go, that is – I've always been a fan of functional programming in general).

*: Elm, Haskell and F#, to be precise.


r/golang • • 1d ago

help IDE says Variable declared above and used in if statement is not used

8 Upvotes

This must be a scoping issue, but I can't figure it out or find the answer from google or AI.

My IDE says that "videoFileExists" is declared but not used. But I'm using it inside of the if statement, and the IDE does not show an error at " videoFileExists = true" .

In my mind, of the declared variable wasn't used, then " videoFileExists = true" should show an errors since the variable I'm assigning to has not been declare.

I'm confused. Copilot fusion has no clue either. It wants to delete "var videoFileExists..."

    for _, infoJsonFile := range infoJsonFiles {
        var (
            videoFileExists, videoThumbnailFileExists, videoNfoFileExists bool
        )


        // calculate matching video file basename
        videoFilePath := strings.Replace(infoJsonFile, ".info.json", ".mkv")
        // check if video file exists
        if slices.Contains(videoFiles, videoFilePath) {
            videoFileExists = true
        }

r/golang • • 2d ago

show & tell Go Scheduler: Goroutines Under the Hood

Thumbnail
youtu.be
74 Upvotes

r/golang • • 2d ago

Go proposal tracker

Thumbnail
antonz.org
72 Upvotes

If you are curious about what is coming in the following releases of Go, this is a very nice way to see where the language is leaning. You can see there things like sync.Counter, composite literals without types, or maps.Grow.


r/golang • • 3d ago

discussion .gitignore everything by default

Thumbnail
packagemain.tech
58 Upvotes

r/golang • • 3d ago

help What standards/normalization does Go follow if it’s not ISO-standardized?

2 Upvotes

Hola a todos,

Tengo una pregunta para una tarea de Go. Intento comprender qué "estándares" o "normalización" sigue el lenguaje Go, ya que no parece estar estandarizado por la ISO ni por ningún organismo formal similar.

¿Cuáles son los estándares o especificaciones oficiales/actualizados que rigen Go? ¿Se limitan a la Especificación del Lenguaje Go y la promesa de compatibilidad con Go 1, o existen otros estándares formales/de facto que deba mencionar?

No busco un ensayo completo; solo quiero asegurarme de responder correctamente a la tarea. ¡Gracias!

En resumen: Si Go no está estandarizado por la ISO, ¿qué estándares/especificaciones/convenciones rigen Go actualmente?


r/golang • • 4d ago

help Lesson learned: don't make your internal API client library initialize http.Client per call

51 Upvotes

We had a Go client library for our internal services that created a new http.Client inside each request method, and everything was fine until traffic picked up and we started seeing intermittent connection refused errors under load. Turns out we were throwing away connection pooling entirely, so every request paid the cost of a fresh TCP and TLS handshake. The fix was to instantiate http.Client once (or accept it as a dependency via a functional option) and reuse it across calls, which dropped p99 latency noticeably. Also worth remembering that http.Client is safe for concurrent use, so there's no reason to be shy about sharing it. Took me embarrassingly long to find because the errors looked like network flakiness rather than a client design problem.


r/golang • • 4d ago

fatal error: all goroutines are asleep - deadlock!, visualized goroutine by goroutine (and why your server just hangs instead)

1 Upvotes

I built a page that animates what each goroutine is doing when Go hits this error, one lane per goroutine:

https://threadline-be-fast.vercel.app/go/all-goroutines-asleep/

The what-if switch covers the cases people actually hit:

• wg.Wait() before reading: the workers wait for main, and main waits for the workers.

• The fix: run wg.Wait() + close() in a goroutine and read in main. It prints sum: 5.

• In a server: the same bug gives no error. One goroutine waiting on the network is enough to stop the runtime from proving a deadlock, so the program just hangs

Every timeline has a real Go program behind it, and its tests check the facts on Go 1.26 and 1.27: the wait reasons come from real goroutine dumps, plus the exit code and the hang. It's a side project of mine with 12 Go scenarios so far (scheduler, GOMAXPROCS, races, select, context). It works on a phone.

What Go concurrency behavior would you want to see drawn next? sync.RWMutex and errgroup with SetLimit are on my list.


r/golang • • 4d ago

help How are you managing CVE’s

33 Upvotes

I’m shipping a few Go libraries embedded in a mobile app. Curious how others approach vulnerability scanning and remediation in their Go projects.

Are you mainly relying on dependency updates or scanning the compiled binaries as well?


r/golang • • 5d ago

show & tell Go Escape Analysis in 5 Minutes

Thumbnail
youtu.be
66 Upvotes

r/golang • • 5d ago

A Go cheat sheet that can be useful to beginners

Thumbnail
tms-outsource.com
127 Upvotes

r/golang • • 5d ago

show & tell I built a real-time ad bidder in Go to show how ML works in mobile ad tech

Thumbnail
github.com
29 Upvotes

I wanted to show how machine learning actually works in mobile ad tech, using Go for the bidder, so I wrote a free, open-source book with a working DSP you can run locally.

The bidder answers OpenRTB bid requests from a simulated ad market (written in Python, so it knows the true click and install rates to check the models against) and serves its models right in the bid path: LightGBM trees and a small deep model, both in pure Go with no cgo.

Book: https://bgweber.github.io/AdtechBook/
Code: https://github.com/bgweber/AdtechBook (bidder in code/dsp)

You don't need Rust for low-latency ML serving. In my experience, Go is on par with Rust for a bid path: with zero allocations per prediction, the GC stays out of the latency budget. And with GoMLX, Go now has an XLA backend for fast CPU inference, ONNX model loading, and online fine-tuning inside a Go service, something ONNX Runtime can't do. The book covers it in the deep-model serving chapter.

Happy to answer questions about the Go side or ad tech in general.


r/golang • • 6d ago

show & tell Limen: auth library for Go, now with passkeys, admin tools, and database hooks

Thumbnail
github.com
59 Upvotes

A few months ago, I shared Limen’s Organization and API Key plugins here. Since then, I’ve continued expanding the library and recently released v0.2.5.

The main additions are:

  • Passkeys — registration, authentication, passkey-first signup, re-authentication, extensions, and TypeScript client support.
  • Admin plugin — user management, roles and permissions, bans, impersonation, email/password changes, and session revocation.
  • Improved email verification — verification challenges, optional verified-email requirements for sign-in, and resending verification without an active session.
  • Session/JWT improvements — signed tokens, custom claims, refresh-token handling, revocation, and blacklisting.
  • Database hooks — run code before or after create, update, and delete operations.

Repo: https://github.com/thecodearcher/limen
Docs: https://limenauth.dev


r/golang • • 6d ago

errortype v0.0.12: auto-fixing Go error names, and how it fits with ptrtoerror in gopls

26 Upvotes

errortype is a linter that finds inconsistent uses of Go error types. v0.0.12 can rename errors to follow the naming conventions, checks %w operands of fmt.Errorf, and prepares you for a new go vet check in Go 1.27.

gopls v0.24 ships a new analyzer, ptrtoerror, that reports when an error type is used both as a value E and as a pointer *E. That's the idea errortype is built around. Because ptrtoerror is on by default, a lot of Go developers will now see these bugs while they write code. Kudos to the gopls team!

The two analyzers complement each other. ptrtoerror asks you to declare which form you mean, and errortype already uses these declarations and checks more places, like %w operands and errors.As targets. More on that below.

Error naming, fixed automatically

The Go conventions say sentinel errors start with Err (ErrNotFound) and error types end with Error (ParseError). The name tells readers and tools whether to match with errors.Is or query with errors.AsType.

-naming checks this. On a large codebase nobody wants to rename errors by hand, so -fix renames the declarations and their uses in the package. You can run it on a whole module, or fix new names as you write them:

-var NotFound = errors.New("not found")
+// Deprecated: Use [ErrNotFound] instead.
+var NotFound = ErrNotFound
+
+var ErrNotFound = errors.New("not found")

-type ErrParse struct{ Line int }
+// Deprecated: Use [ParseError] instead.
+//
+//go:fix inline
+type ErrParse = ParseError
+
+type ParseError struct{ Line int }

Exported declarations keep the old name with a // Deprecated: comment so other packages keep compiling. Deprecated type aliases get //go:fix inline, so go fix ./... migrates their uses, while uses of renamed var sentinels in other packages are left to you. You can preview the names with -fix -diff.

-naming is off by default. Try it during development (included in -recommended), and turn it on in CI once you're compliant.

%w operands are checked

The following program sums up numbers, one per line, but never hits its ParseError branch, printing the generic fallback instead (full version on the Go Playground):

type ParseError struct {
	Line int
	Err  error
}

func (e ParseError) Error() string { return fmt.Sprintf("line %d: %v", e.Line, e.Err) }

// in sumLines:
	return 0, fmt.Errorf("sum: %w", ParseError{Line: line, Err: err}) // wrapped as a value

// in printError:
	if perr, ok := errors.AsType[*ParseError](err); ok { // never matches

$ go run .
unexpected error: sum: line 3: strconv.Atoi: parsing "3x": invalid syntax

$ errortype .
.../main.go:48:17: Error type "ParseError" should be queried as a value ("errors.AsType[ParseError]"), not a pointer. (et:ast)

The program compiles, and nothing complains. The %w operand is passed as any, and *ParseError implements error just like ParseError. errortype now counts %w operands as evidence for the intended form, so it tells you to fix the query. When a pointer Unwrap method already settles the form, it reports the %w operand instead.

A new go vet check in Go 1.27

In files at go 1.27 or later, go vet's printf check now reports %w on *E whenever E itself implements error. Because this depends on the file's Go version (usually the go directive in go.mod) rather than the toolchain, go vet stays quiet even with a Go 1.27 toolchain, until you bump go.mod to 1.27. At that point it starts flagging working code, like an error type with a value receiver that is consistently used as a pointer (Go Playground, try editing the go.mod part at the bottom):

type StatusError struct{ Code int }

func (e StatusError) Error() string { return fmt.Sprintf("status %d", e.Code) }

func get() error {
	// go vet at go 1.27: %w wants operand of error type StatusError, not pointer type *StatusError (defeats errors.Is)
	return fmt.Errorf("get: %w", &StatusError{404})
}

errortype -receivers flags the receiver. At go 1.27 or later, it's reported by default:

.../main.go:10:6: Method "Error" should be implemented with a pointer receiver ("func (*StatusError) Error"), not a value receiver (et:rcv+)

With a pointer receiver, only *StatusError implements error. go vet has nothing to report, and the compiler rejects returning StatusError{...}.

Fix these while you're still on go 1.26, and you won't have to when you upgrade. After raising the go directive, go vet can still report types that only embed an error or come from a dependency.

Legacy error query helpers

Pre-Go 1.13 helpers like func IsNotFound(err error) bool with a plain type assertion ignore wrapped errors. -legacy reports them, and -fix rewrites them to errors.AsType (or errors.As on files below Go 1.26), correcting the pointer or value form at the same time. It's off by default for now and might be turned on later.

Found in real projects

errortype recognizes wrapper functions around the errors package, and that's how it found bugs in Grafana Loki, Canonical Juju and Chromium's LUCI: error handlers passed invalid targets to errors.As through github.com/pkg/errors, github.com/juju/errors and LUCI's own errors package, and would have panicked the first time they ran. All three are fixed upstream.

The latest one is in Grafana Mimir, and this time every conversion used the same form. The compactor counts failed block uploads by file type, using UploadError:

type UploadError struct {
	cause    error
	fileType FileType
}

func (e UploadError) Error() string { return fmt.Sprintf("failed to upload %s: %v", e.fileType, e.cause) }

func (e *UploadError) Unwrap() error { return e.cause }

Every return in the package used the value UploadError{...}. The compactor checked for a *UploadError with errors.As, which never matched, so every known failure was counted as type="unknown". The pointer Unwrap also hid the cause from errors.Is.

#12477 fixed the bug by returning &UploadError{...}. errortype reports those value returns on the old code, and on current main it still reports the root cause:

$ errortype ./pkg/storage/tsdb/block
.../block/block.go:66:6: Method "Error" should be implemented with a pointer receiver ("func (*UploadError) Error"), like "Unwrap" (et:rcv+)
...

It also reports three places in the tests that still use the value form, one of which ptrtoerror flags as well. With a pointer receiver, a value return no longer compiles, so the bug can't come back. I've sent that fix upstream as #17467. The README has a minimal version of this pattern.

errortype and ptrtoerror from gopls

ptrtoerror is strict about types where both E and *E implement error. When the defining package doesn't show which form it means, gopls asks you to add var _ error = ... and offers that as a quick fix.

Each of these declarations helps errortype. It has recommended them from the start, because then it doesn't have to infer the form. With gopls asking, far more packages will declare their intent.

errortype covers code without declarations as well, since it infers the form from how a type is used. None of the bugs above involved an inconsistent conversion. I run errortype before I commit and in CI, and as a golangci-lint plugin in my editor.

Try it

go install fillmore-labs.com/errortype@v0.0.12
errortype -recommended ./...

Feedback is very welcome.


r/golang • • 6d ago

HTTPAPI: a typed HTTP contract layer for Go services

0 Upvotes

Purpose: introduce a Go package we have been using in two Inttegro services since July.

HTTPAPI keeps an endpoint’s method, path and handler alongside its authorization, caller, idempotency, timeout, request-size, accounting and routing requirements. The same contracts can be transcribed into OpenAPI. It deliberately does not own the application’s database, auth provider, logging, deployment or configuration.

A shortened definition looks like this:

var CreateTask = endpoint.DefineEndpoint(endpoint.EndpointSpec{
  Method:  endpoint.POST,
  Path:    "/tasks/create",
  Handler: createTask,
  Access: endpoint.EndpointAccessSpec{
    Authorization: endpoint.RequiredAuthorization(endpoint.AuthorizationKindBearer),
    Callers: []caller.Caller{PublicAPI, Dashboard},
  },
  Idempotency: endpoint.EndpointIdempotencySpec{Enabled: true},
  Limits: endpoint.EndpointLimitsSpec{MaxRequestBytes: 64 << 10},
})

Current state: one maintainer, 77 commits, specification version 0.2, and use in our own services. I am not claiming broad ecosystem adoption or production maturity outside our own system.

Package and specification: https://github.com/inttegro/httpapi

The design question for us was not how to replace net/http. It was how to stop endpoint requirements from being scattered across a handler, middleware, router and separate API description.