InnerVault

Go Service taste

Indexedprompts.chat (CC0 prompt collection), f

# Go service taste of a backend engineer - Use the standard library net/http router from Go 1.22 before reaching for a framework. Confidence: 0.85 - Lay the project out as cmd/<service>/main.go plus internal/ packages…

Open the source (opens github.com) https://github.com/f/prompts.chat

What it is

Prompts from f.

The problem it solves and who it suits haven't been reviewed by InnerVault. The description above is the source's own.

The prompt

# Go service taste of a backend engineer
- Use the standard library net/http router from Go 1.22 before reaching for a framework. Confidence: 0.85
- Lay the project out as cmd/<service>/main.go plus internal/ packages, and skip pkg/. Confidence: 0.80
- Keep main.go thin: read config, wire dependencies and start the server. Confidence: 0.90
- Pass context.Context as the first argument to every function that does I/O. Confidence: 0.95
- Wrap errors with fmt.Errorf and %w, and check them with errors.Is and errors.As. Confidence: 0.95
- Log with log/slog in JSON format and include a request ID on every line. Confidence: 0.90
- Read configuration from environment variables into one typed struct at startup. Confidence: 0.85
- Fail fast at startup when required configuration is missing. Confidence: 0.90
- Write SQL by hand and generate typed code with sqlc instead of using an ORM. Confidence: 0.80
- Use pgx as the Postgres driver with a connection pool. Confidence: 0.85
- Define small interfaces in the package that consumes them, not the one that implements them. Confidence: 0.85
- Use table-driven tests with t.Run subtests. Confidence: 0.90
- Run go test with -race in CI on every pull request. Confidence: 0.90
- Lint with golangci-lint using a short, curated list of linters. Confidence: 0.80
- Shut down gracefully on SIGTERM with signal.NotifyContext and server.Shutdown. Confidence: 0.90
- Set explicit read, write and idle timeouts on every http.Server and http.Client. Confidence: 0.90
- Expose /healthz for liveness and /readyz for readiness. Confidence: 0.85
- Avoid global state and package-level init functions with side effects. Confidence: 0.85
- Start goroutines only with a clear owner and stop condition, using errgroup for groups. Confidence: 0.85
- Build a static binary into a distroless image with a multi-stage Dockerfile. Confidence: 0.80
- Add generics only when they remove real duplication. Confidence: 0.70

Written by the prompts.chat (CC0 prompt collection) community (f). Not tested by InnerVault.

How to get it

Setup steps: not applicable.

Related

  1. <!-- LLM System Prompt Start --> # LLM Skill: Go Industrial Autonomous Business Module Coding Spec (shanjunmei/dig Compile-Time DI) Type: System Prompt / Agent Skill Model Compatible: Doubao / GPT / Claude / Qwen…

    Indexed prompts.chat (CC0 prompt collection), shanjunmei CC0-1.0

  2. # COMPREHENSIVE GO CODEBASE REVIEW You are an expert Go code reviewer with 20+ years of experience in enterprise software development, security auditing, and performance optimization. Your task is to perform an…

    Indexed prompts.chat (CC0 prompt collection), ersinkoc CC0-1.0

  3. <!-- LLM System Prompt Start --> # LLM Skill: shanjunmei/dig Go DI Development Assistant Type: System Prompt / Agent Skill Model Compatible: Doubao / GPT / Claude / Qwen Scene: Go dig library code generation…

    Indexed prompts.chat (CC0 prompt collection), shanjunmei CC0-1.0

  4. Act as a friendly coding teacher. You are going to create a video to explain your code to your professor in a casual and engaging manner. Your task is to create a script for the video in which you: - Introduce the…

    Indexed prompts.chat (CC0 prompt collection), IcyMost CC0-1.0

  5. PRD

    Prompts

    You are a Senior Product Manager with expertise in writing comprehensive Product Requirements Documents (PRDs). We are going to collaborate on writing a PRD for: [${your_productfeature_idea}] IMPORTANT: Before we begin…

    Indexed prompts.chat (CC0 prompt collection), SynapticSolutionsAI CC0-1.0

  6. a lot of people even professional said a software product or platfrom especially which has complex rules which was fully coded by AI by a vibe coder who deosnt understand what is the arcture concept deployed, read and…

    Indexed prompts.chat (CC0 prompt collection), hussen.sepa@gmail.com CC0-1.0