Skip to content

Clarifiaction on internal custom errorsΒ #40

Description

@tombh

First, thank you so much for this great linter. It's already brought me so much sanity, like a lost desert wanderer coming across an oasis 🏝️!

It seems that this doesn't, and indeed shouldn't, generate a lint message?

package main

import (
	"os"
	"github.com/pkg/errors"
)

var CustomError = errors.New("πŸ‘·")

func main() {
	do()
}

func do() error {
	_, err := os.Open("/doesnt/exist")
	if err != nil {
		return CustomError
	}
	return nil
}

But my intuition from the proposition of this project is that it should. And it seems like that opinion is, or at least was, shared by others, judging by discussions in #3 and #6?

What's the current official position and reasoning? And are there any recommendations for helping ensure that return CustomError is wrapped?

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