Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

replace juju/errors because of CNCF license scan report #457

Closed
mars1024 opened this issue Feb 23, 2020 · 1 comment
Closed

replace juju/errors because of CNCF license scan report #457

mars1024 opened this issue Feb 23, 2020 · 1 comment
Assignees
Labels

Comments

@mars1024
Copy link
Member

Just as the newest license scan report from CNCF, juju/errors will not be suitable to be used in our repos.
We should find another way to replace it.

@mars1024 mars1024 self-assigned this Feb 23, 2020
@mars1024
Copy link
Member Author

Err in juju/errors is just like below

func (e *Err) Error() string {
	// We want to walk up the stack of errors showing the annotations
	// as long as the cause is the same.
	err := e.previous
	if !sameError(Cause(err), e.cause) && e.cause != nil {
		err = e.cause
	}
	switch {
	case err == nil:
		return e.message
	case e.message == "":
		return err.Error()
	}
	return fmt.Sprintf("%s: %v", e.message, err)
}

So I will replace it with fmt.Errorf ..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant