zalando / go-keyring

Cross-platform keyring interface for Go
MIT License
811 stars 82 forks source link

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

Closed jxsl13 closed 1 year ago

jxsl13 commented 2 years ago

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")
)