Repository navigation
Rename die to dief - #62
Merged
Merged
Conversation
korya
force-pushed
the
korya-refactor-dief
branch
from
August 7, 2026 22:22
74c0d5a to
ac750bc
Compare
korya
marked this pull request as ready for review
August 7, 2026 22:23
die takes a format string and variadic arguments but carried no f, so nothing at the call site distinguished it from a function taking a literal message. The standard library settles this with a suffix -- Printf, Fatalf, Errorf -- and following it means a reader can tell which of these is safe with untrusted text containing a percent sign. Renames the function and its seven call sites. No behaviour change: the format strings, exit codes and output are untouched, which the exit-code tests and the 100.0% coverage confirm. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019EMMhgmTkbzAsmeNy97PrP
korya
force-pushed
the
korya-refactor-dief
branch
from
August 7, 2026 22:25
ac750bc to
8bf824f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
dietakes a format string and variadic arguments but carried nof, so nothing at the call site distinguished it from a function taking a literal message.The standard library settles this with a suffix —
Printf,Fatalf,Errorf. Without it, a reader has to open the definition to know whether the first string is a format, which matters because passing untrusted text containing a%to a format-taking function silently produces%!d(MISSING)in the output.Solution
Rename to
dief.Before / after:
Seven call sites renamed alongside the definition, plus a one-line doc comment on what the function does. No behaviour change — format strings, exit codes and output are untouched.
Verified by exercising every exit code the function produces:
--log-level trace--maphost garbage--assert-body '[bad'-X 'BAD METHOD'--nopeCoverage stays at 100.0%. No visual change — headless CLI.
🤖 Generated with Claude Code