Go

Share Go code online.

Share Go service code, CLI tools, or concurrency patterns: syntax-highlighted and encrypted with a single paste.

textdrop.sh/xk4mR2
1package main23import (4	"context"5	"fmt"6	"log/slog"7	"net/http"8	"os/signal"9	"syscall"10	"time"11)1213func main() {14	mux := http.NewServeMux()15	mux.HandleFunc("GET /health", func(w http.ResponseWriter, r *http.Request) {16		fmt.Fprintln(w, "ok")17	})1819	srv := &http.Server{Addr: ":8080", Handler: mux, ReadTimeout: 5 * time.Second}20	ctx, stop := signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM)21	defer stop()2223	go func() {24		slog.Info("listening", "addr", srv.Addr)25		if err := srv.ListenAndServe(); err != http.ErrServerClosed {26			slog.Error("server error", "err", err)27		}28	}()2930	<-ctx.Done()31	shutCtx, cancel := context.WithTimeout(context.Background(), 5*time.Second)32	defer cancel()33	srv.Shutdown(shutCtx) //nolint:errcheck34}
Every paste includes

Go syntax highlighting

Paste Go code and get a shareable link with full syntax highlighting, server-side rendered with no JavaScript overhead.

Burn after read

Deleted on first open. Can't be viewed twice.

Password protection

Add a password for end-to-end encryption with no raw key stored.

Configurable expiry

Set pastes to expire after 1 hour, 1 day, 7 days, or up to 30 days. Gone when you say so.

No account needed

No sign-up, no email, no ads. Paste and share in seconds.

How it works
Plain Text
Markdown
Code
DB_HOST=db-01.prod.internal
DB_USER=api_svc
DB_PASS=xK9$mP2!qR7nLw2
REDIS_URL=redis://:abc@cache:6379
delete after setup — expires 1hr
7 days
Share
textdrop.sh/
7 days · plain text
Use cases
  • 01Share HTTP handler patterns
  • 02Send goroutine / channel examples
  • 03Distribute CLI tool snippets
  • 04Share interface implementations for review
  • 05Send error handling patterns to teammates
FAQ
Does textdrop.sh support Go modules syntax?+

Select Go for .go files. For go.mod files, plain text or TOML works best.

Can I share multiple Go files?+

textdrop.sh is optimized for single-file snippets. For multi-file packages, paste the key file and link to your repository.

Is my code encrypted?+

Yes. AES-256-GCM encryption runs in your browser before upload. Non-password pastes store the raw data key server-side for simple sharing and raw access; password-protected pastes keep the raw key out of the server.

Other languages
Drop your code