Skip to content
This repository was archived by the owner on Dec 1, 2021. It is now read-only.
This repository was archived by the owner on Dec 1, 2021. It is now read-only.

Wrap argument name cause could be err #32

@matryer

Description

@matryer

This might seem a little strange, but I think cause as an argument name to Wrap and Wrapf is unnecessary. I wonder if err might be good enough?

Here are some reasons:

  1. it's obvious that we're wrapping an error that caused the need to add context in the first place
  2. there's only one argument of type error
  3. it is possible the argument is not the 'root' cause, so in a sense, isn't the 'cause'
  4. IDE plugins will autofil and most of the time, the variable name would be err so you could just tab past it

Very minor issue, and mainly I'm trying to save myself two key-presses each time I use this (which I will every day).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions