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

Include if with inline error handling #1268

Merged
merged 1 commit into from
May 4, 2017
Merged

Conversation

Foxboron
Copy link
Contributor

@Foxboron Foxboron commented Apr 23, 2017

This pattern is widely enough used to be a snippet i believe.
Examples from one golang.org example.

// ...
   if err := cmd.Start(); err != nil {
   	log.Fatal(err)
   }
// ...
   if err := json.NewDecoder(stdout).Decode(&person); err != nil {
   	log.Fatal(err)
   }
   if err := cmd.Wait(); err != nil {
   	log.Fatal(err)
   }

@fatih
Copy link
Owner

fatih commented Apr 24, 2017

I think the current snippets are well defined @Foxboron You're free to define your own ones. Plus no ones fatal.

We can improve two things here:

  1. remove the log.Fatal part and jump there with the next step
  2. also add it to neopsnippet file

Once these are done, I think we can merge this PR.

@Foxboron
Copy link
Contributor Author

Done. Also modified the commit message. I don't use neosnippet so i hope that definition is correct.

Signed-off-by: Morten Linderud <morten@linderud.pw>
@fatih
Copy link
Owner

fatih commented May 4, 2017

Thanks @Foxboron 👍

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

Successfully merging this pull request may close these issues.

2 participants