frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Show HN: errdef – typed, structured error definitions in Go

https://github.com/shiwano/errdef
1•shiwano•2h ago
Hi HN, I'm the author of errdef.

This library grew from a core idea: that by separating static error definitions (the "what") from dynamic instances (the "why"), we could resolve the common trade-offs between context, type identity, and boilerplate.

This design allows you to create errors with context-specific, type-safe fields without losing their original identity.

Key features:

* Consistent structure for logging, metrics, and APIs

* Compile-time safety for fields (DefineField[T]).

* Clean integration with the Go ecosystem (errors.Is/As, fmt, json, and slog).

* Extensible deserialization (JSON, Protobuf, etc.)

* Built-in redaction for sensitive data (Redacted[T]).

Quick example:

  // Define once
  var ErrNotFound = errdef.Define("not_found", errdef.HTTPStatus(404))
  var UserID, _ = errdef.DefineField[string]("user_id")

  // Create instances
  err := ErrNotFound.With(ctx, UserID("u123")).New("user not found")

  // Still works with standard `errors.Is`
  errors.Is(err, ErrNotFound) // true
I'd love to get your feedback. How does this approach compare to the error handling patterns you use?

Ask HN: What metrics do you measure for your AI features

1•rudderdev•1m ago•0 comments

"Like putting on glasses for the first time": how AI improves quake detection

https://arstechnica.com/science/2025/10/like-putting-on-glasses-for-the-first-time-how-ai-improve...
1•nxobject•2m ago•0 comments

Despite what's happening in the USA, renewables are winning globally

https://thebulletin.org/2025/10/despite-whats-happening-in-the-usa-renewables-are-winning-globally/
1•pseudolus•3m ago•0 comments

Google faces stricter regulation in UK over search dominance

https://www.reuters.com/sustainability/boards-policy-regulation/uk-gains-new-powers-over-google-w...
1•1vuio0pswjnm7•5m ago•0 comments

Mastering the choice of the perfect Linux distribution for enthusiasts

https://comuniq.xyz/post?t=371
1•01-_-•6m ago•0 comments

The State of AI

https://www.stateof.ai/
1•SMAAART•10m ago•0 comments

Farmers, ranchers cut back Colorado River water use

https://coloradosun.com/2025/10/10/farmers-ranchers-colorado-river-water-use-dry-year/
1•mooreds•11m ago•0 comments

Silicon Valley Chronicler on the Politics of Musk, Sacks and Zuckerberg

https://www.politico.com/news/magazine/2025/10/11/elon-musk-donald-trump-silicon-valley-book-jaco...
1•CharlesW•16m ago•0 comments

The Generic Wellbutrin Problem: Whose Fault Is It? (2012)

https://www.science.org/content/blog-post/generic-wellbutrin-problem-whose-fault-it
1•davikr•16m ago•0 comments

"Just doing things" is not a path to value

https://productpicnic.beehiiv.com/p/action-without-critical-thinking-is
1•mooreds•18m ago•0 comments

Internet Archive Full Text Search

https://archive.org/details/texts?tab=collection&query=%22Hacker+News%22&sin=TXT
1•m-hodges•19m ago•0 comments

Ask HN: LLM coin flipping – lands on heads

1•razodactyl•23m ago•0 comments

Japan Needs Foreign Workers. Its Far Right Is Turning Against Them

https://www.bloomberg.com/news/features/2025-10-09/japan-s-far-right-alarms-foreign-workers-in-to...
4•mooreds•25m ago•1 comments

Startup completes world-first remote robotic surgery

https://www.smh.com.au/technology/australian-start-up-completes-world-first-remote-robotic-surger...
1•nreece•26m ago•0 comments

Show HN: Credkit – Easier Loan Modeling

https://github.com/jt-hill/credkit
1•jt-hill•28m ago•1 comments

Google won't reveal if it lobbies Trump about YT's inclusion in OZ under-16s ban

https://www.theguardian.com/technology/2025/oct/13/google-wont-reveal-if-it-is-lobbying-trump-abo...
3•ggm•30m ago•0 comments

For Centuries Meals Amazed Visitors to Korea

https://www.atlasobscura.com/articles/history-of-korean-food
2•carabiner•33m ago•0 comments

Show HN: YPS: YAML Positioning System

https://github.com/taichi-ishitani/yps
1•taichi730•33m ago•0 comments

Soft Drinks' Effect on the Gut Tied to Increased Risk for Major Depression

https://www.medscape.com/viewarticle/soft-drinks-effect-gut-tied-increased-risk-major-depression-...
1•wjb3•35m ago•0 comments

The Curve of Binding Energy–I (1973)

https://www.newyorker.com/magazine/1973/12/03/the-curve-of-binding-energy-i
1•NaOH•36m ago•0 comments

Science on a Sphere: Aerosols in the Air

https://svs.gsfc.nasa.gov/5552/
1•gmays•39m ago•0 comments

Toward Perpetual Violence

https://www.machineculture.io/p/toward-perpetual-violence
1•ryanhauser•46m ago•1 comments

I Almost Quit

1•Blarckat•1h ago•1 comments

Next obsession: retro Japanese video game art

https://theoutline.com/post/2623/beauty-japanese-playstation-dreamcast-video-game-art-wipeout-fin...
1•vinipolicena•1h ago•0 comments

Exposure to Commonly Used Chemical Tied to Parkinson's Disease Risk

https://www.medscape.com/viewarticle/exposure-commonly-used-chemical-tied-parkinsons-disease-risk...
2•wjb3•1h ago•2 comments

Battlefield6 Sensitivity Converter

https://battlefield6sensitivityconverter.com/
1•lleymrl651•1h ago•1 comments

Privacy Isn't Dead – It's Being Sold in Pieces

1•SilentByte•1h ago•0 comments

City lizards are more social

https://royalsocietypublishing.org/doi/10.1098/rsbl.2025.0326
1•PaulHoule•1h ago•0 comments

Mortgage tech firm, big lenders accused of nationwide price-fixing scheme

https://www.reuters.com/legal/government/mortgage-tech-firm-big-lenders-accused-nationwide-price-...
6•1vuio0pswjnm7•1h ago•0 comments

Show HN: Inscribe – Execute code blocks inside Markdown to get living documents

https://github.com/tesserato/Inscribe
1•tesserato•1h ago•0 comments