Uploaded image for project: 'Couchbase Server'
  1. Couchbase Server
  2. MB-50311

[CV] Add a check/git hook which asserts that no partially unwrapped errors exist (e.g. fmt.Errorf("%w", err))

    XMLWordPrintable

Details

    • Task
    • Resolution: Unresolved
    • Minor
    • Morpheus
    • 7.1.0
    • tools
    • None
    • 1

    Description

      What's the issue?
      Part of my workflow is to fill out wrapped error messages during the later stage of development (since it's likely errors are due to change during active development).

      This means I often leave the following dotted around the code base:

      if err != nil {
          fmt.Errorf("%w", err) // TODO
      }
      

      All those with TODOs will be done prior to merge (as we lint using 'godox'), however, we should add a linter/check to assert that none of these types of "partially" wrapped errors are making it into the code base (as of now - master - none have made it in).

      This is purely a QOL change.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            james.lee James Lee
            james.lee James Lee
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty