Awesome Reviewers

Reviewer · Code Style

Simplify and deduplicate code

Favor clear, non-redundant code structures over repetitive or unnecessarily nested logic. When a function contains many near-identical sequential statements (e.g., a long chain of similarly-shaped request constructions), extract the common pattern into a helper function, a loop, or a slice-driven iteration rather than repeating the same boilerplate many...

Instruction

Favor clear, non-redundant code structures over repetitive or unnecessarily nested logic. When a function contains many near-identical sequential statements (e.g., a long chain of similarly-shaped request constructions), extract the common pattern into a helper function, a loop, or a slice-driven iteration rather than repeating the same boilerplate many times. Likewise, collapse unnecessarily nested conditionals into a single combined condition when it doesn’t hurt readability, e.g.:

// Prefer:
if c.flagSHA256 != "" && (command == "" && c.flagOCIImage == "") {
    ...
}

// Over nesting:
if c.flagSHA256 != "" {
    if command == "" && c.flagOCIImage == "" {
        ...
    }
}

Avoid duplicate or redundant statements, such as calling defer resp.Body.Close() more than once when a single deferred call suffices. Also follow established language idioms to keep code clean and linter-friendly: use _ for parameters that are intentionally unused, and ensure doc comments on functions/tests begin with the identifier name they document (e.g., a test named TestRotateRootWithRotationUrl should have its comment start with TestRotateRootWithRotationUrl ...) so tooling and other developers can easily follow the code’s intent. The goal is to minimize boilerplate, reduce visual noise, and make the logic’s intent immediately clear to reviewers and future maintainers.