Write, debug, and tune Playwright specs with locator strategy, trace diagnosis, and CI-aware timeouts.
Coding
Goenv
Try itGo library that reads the ENV variable and returns "dev" only if exactly "dev", otherwise "prod" with boolean helpers and fail-safe defaults.
What it does
A Go library that reads a single environment variable — — and answers one question: are you in or ? That's the whole package. with a fail-safe default and three named helpers, zero dependencies. Import it and call .
The skill document
goenv
A Go library that reads a single environment variable — ENV — and answers one question: are you in prod or dev? That's the whole package. os.Getenv("ENV") with a fail-safe default and three named helpers, zero dependencies. Import it and call goenv.Get().
For install, the exact match/default behavior, and a worked example, see references/setup.md.
Security & safety
- It reads exactly one environment variable —
ENV— and nothing else. No other env vars are read, nothing is written to disk, no network calls are made at runtime, and no data leaves your process. Its only import is the stdlibos. - It's a library you compile into your own binary — it has no runtime surface of its own. Whatever your program does with the prod/dev answer is on you, same as any code you'd write by hand.
- Fail-safe by design: an unrecognized or unset
ENVresolves toprod, so a misconfigured environment errs toward production-grade behavior rather than accidentally enabling dev-only shortcuts.
When to use
- A Go program needs a small, dependency-free way to branch behavior between two environments (prod vs dev) — e.g. verbose logging in dev, stricter defaults in prod.
- The project already imports
github.com/psyb0t/goenvand you want to add or read a prod/dev check consistently (goenv.IsProd()/goenv.IsDev()instead of hand-rolledos.Getenvcomparisons). - You want the fail-safe "default to prod" semantics without writing the switch yourself.
When NOT to use
- You need more than two environments (staging, test, ci, local, …) — goenv only knows
devandprod; everything that isn't exactly"dev"collapses toprod. - You need to read env vars other than
ENV, or a configurable variable name — goenv reads the hardcodedENVand nothing else. Reach for a real config library (e.g.gonfiguration) for anything richer. - You expect compile-time type safety from the
Typetype — it's astringalias, sogoenv.Typeisstring; the constants are conveniences, not an enum, and any string is assignable. If you need a distinct nominal type, this isn't it.
Usage
import "github.com/psyb0t/goenv"
// The current environment as a string ("prod" or "dev"):
switch goenv.Get() {
case goenv.Dev:
// dev-only behavior
default: // goenv.Prod
// prod behavior
}
// Or the boolean shortcuts:
if goenv.IsDev() {
logger.SetLevel("debug")
}
if goenv.IsProd() {
enableStrictMode()
}
// The recognized values and the variable name are exported constants:
_ = goenv.Prod // "prod"
_ = goenv.Dev // "dev"
_ = goenv.EnvVarName // "ENV"
The mapping is exact: Get() returns Dev only when ENV is precisely "dev"; every other value — unset, empty, "DEV", "development", "prod", or anything else — returns Prod. Set it before your process starts:
ENV=dev ./yourapp # dev
ENV=prod ./yourapp # prod
./yourapp # ENV unset → prod (the default)
For the module path, supported Go version, and the full behavior table, see references/setup.md.
Related skills
Join a video meeting as an AI bot with voice, avatar, and screenshare across four operating modes.
Find why your productivity system keeps failing, then apply the smallest fix — capacity math, bottleneck routing, durable local notes.
Generate and edit Draw.io, Mermaid, and Excalidraw diagrams from natural language using a structured JSON spec.
Run Git operations — commits, branches, merges, rebases, conflict resolution, and recovery — with safety rules enforced.
Save, search, and manage personal notes and knowledge bases in Get笔记 on explicit request.
More from psyb0t
Browse all skillsDrive a user-deployed mt5-httpapi MetaTrader 5 bridge over HTTP, with per-action confirmation on every real-money call.
Docker-packaged browser automation for QA against anti-bot stacks and authorized detection testing.
Self-hosted OpenAI-compatible speech service — transcription, translation, and synthesis from one container.
Run ffmpeg, sox, and ImageMagick jobs against your files in a fixed-allowlist SSH sandbox.
Generate speech audio via Qwen3-TTS over SSH with preset voices, voice cloning, and voice design.
Drive one or more IMAP/SMTP mailboxes through a single REST + MCP endpoint — read, search, send, mark-seen, and delete across accounts in parallel.