zalando / go-keyring

Cross-platform keyring interface for Go

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

use errors.New("not found") instead of fmt.Errorf(...)

jxsl13 opened this issue · comments

fmt.Errorf is usually used with the first parameter being a format string.
In your case there is a plain string used, so errors.New(..) should suffice.

If you want to be more fancy, you may implement the error interface like this

type Error string

func (e Error) Error() string {
  return string(e)
}
const (
  ErrNotFound = Error("not found")
)