Skip to content

Redundant param passing #22

Closed
Closed

Description

@TheRootDaemon

Avoid passing r.w explicitly to renderer methods

Most of the Renderer methods pass the renderer's writer r.w as an explicit argument.
But it is already encapsulated in the object or the pointer.

For example:

if err := r.renderDescriptions(r.w, p.Description, p.URL); err != nil {
    return err
}

if err := r.renderExamples(r.w, p.Examples); err != nil {
    return err
}

The writer could instead be accessed directly inside these methods:

if err := r.renderDescriptions(p.Description, p.URL); err != nil {
    return err
}

if err := r.renderExamples(p.Examples); err != nil {
    return err
}

Activity

  1. TheRootDaemon commented on Oct 26, 2026

    @TheRootDaemon
    OwnerAuthor

    Resolved in #23

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions