Skip to content
This repository has been archived by the owner on Dec 1, 2021. It is now read-only.

Add errors.Errorf method #13

Closed
scorredoira opened this issue Apr 26, 2016 · 4 comments
Closed

Add errors.Errorf method #13

scorredoira opened this issue Apr 26, 2016 · 4 comments

Comments

@scorredoira
Copy link
Contributor

scorredoira commented Apr 26, 2016

Hi, would it make sense to have a Newf method to avoid having to write this?

 errors.New(fmt.Sprintf("something %v", x))

If you think it does I can make a PR.

Thank you

@davecheney
Copy link
Member

probably errors.Errorf would be better.

On Tue, Apr 26, 2016 at 9:17 PM, Santiago Corredoira Lascaray <
notifications@github.com> wrote:

Hi, would it make sense to have a Newf method to avoid having to write
this?

errors.New(fmt.Errorf("something %v", x))

If you think it does I can make a PR.

Thank you


You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub
#13

@scorredoira
Copy link
Contributor Author

yes, much better, Newf didn't sound right :)

@scorredoira
Copy link
Contributor Author

I saw the note. So how should I do it, amend to the last commit, two commits or create a new PR? Also, I didn't think it was worth it to add a test for such a simple addition. Is it OK?

@davecheney davecheney changed the title Newf method? Add errors.Errorf method Apr 26, 2016
@davecheney
Copy link
Member

I saw the note. So how should I do it, amend to the last commit, two commits or create a new PR? Also, I didn't think it was worth it to add a test for such a simple addition. Is it OK?

Just amend the existing PR.

Please add a test, everything needs a test to ensure it continues to work. Adding an example means we get documentation for free.

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

No branches or pull requests

2 participants