go

go
package flags

import (
  "context"
  "encoding/json"
  "sync/atomic"

Feature flag snapshot with periodic refresh and atomic reads

go config reliability
by Leah Thompson 1 tab
go
package export

import (
	"encoding/csv"
	"log"
	"net/http"

Streaming Large CSV Exports in Go Without Buffering the Whole File

go http csv
by codesnips 3 tabs
go
package middleware

import (
  "net/http"

  "golang.org/x/time/rate"

Inbound rate limiting middleware with token bucket

go http rate-limit
by Leah Thompson 1 tab
go
package health

import (
  "context"
  "net"
  "net/http"

Readiness and liveness probes with dependency checks

go http kubernetes
by Leah Thompson 1 tab
go
package store

import (
  "context"

  sq "github.com/Masterminds/squirrel"

Safe dynamic SQL with squirrel (optional filters, stable ordering)

go sql postgres
by Leah Thompson 1 tab
go
package scheduler

import (
	"context"
	"log"
	"sync"

Graceful Cron-Style Scheduler in Go With Ticker and Context Cancellation

scheduler ticker context
by codesnips 3 tabs
go
package observability

import (
  "context"

  "go.opentelemetry.io/otel"

OpenTelemetry tracer provider with ratio-based sampling

go observability opentelemetry
by Leah Thompson 1 tab
go
package store

import (
  "context"
  "time"

pgxpool initialization with max connections and statement timeout

go postgres pgx
by Leah Thompson 1 tab
go
package api

import (
  "encoding/json"
  "net/http"
)

Consistent JSON responses (content-type + error envelopes)

go http json
by Leah Thompson 1 tab
go
package middleware

import (
  "net/http"
  "sync/atomic"
)

Track in-flight requests with atomic counters

go observability concurrency
by Leah Thompson 1 tab
go
package feed

import (
	"encoding/base64"
	"encoding/json"
	"time"

Cursor-Based Keyset Pagination for a Postgres Feed API in Go

go postgres pagination
by codesnips 3 tabs
go
package store

import (
  "context"
  "database/sql"
)

db/sql prepared statements with context and explicit Close

go sql postgres
by Leah Thompson 1 tab