Files
hugo/AGENTS.md
T
Bjørn Erik Pedersen 3f9d0ad2b6 commands: Fix --panicOnWarning flag having no effect with module version warnings
The --panicOnWarning flag was not wired into the root command's logger,
so warnings emitted during config loading (such as module version
incompatibility warnings) would not trigger a panic.

Bind the panicOnWarning flag to the rootCommand struct and set the
PanicOnWarningHook on the logger created in createLogger.

Fixes #14524

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-16 22:34:29 +01:00

861 B

  • Brevity is good.
  • Assume that the maintainers and readers of the code you write are Go experts:
    • Don't use comments to explain the obvious.
    • Use self-explanatory variable and function names.
    • Use short variable names when the context is clear.
  • If you need to add temporary debug printing, use hdebug.Printf.1
  • Never export symbols that's not needed outside of the package.
  • Avoid global state at (almost) all cost.
  • This is a project with a long history; assume that a similiar problem has been solved before, look hard for helper functions before creating new ones.
  • In tests, use qt matchers (e.g. b.Assert(err, qt.ErrorMatches, ...)) instead of raw if/t.Fatal checks.
  • Use ./check.sh ./somepackage/... when iterating.
  • Use ./check.sh when you're done.

  1. CI build fail if you forget to remove the debug printing. ↩︎