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

Refactor #9 #10

Merged
merged 3 commits into from
Apr 13, 2014
Merged

Refactor #9 #10

merged 3 commits into from
Apr 13, 2014

Conversation

otiai10
Copy link
Owner

@otiai10 otiai10 commented Apr 10, 2014

2014-04-10 10 05 06

@otiai10 otiai10 mentioned this pull request Apr 10, 2014
@btc
Copy link

btc commented Apr 10, 2014

The error value*

@otiai10
Copy link
Owner Author

otiai10 commented Apr 10, 2014

I'm really glad for your advise!
Because I'm yet on the way to use golang effectively. 😔
Do you mind telling me some documents for best practice of handling error in go.
I want to try that

@btc
Copy link

btc commented Apr 10, 2014

this is a start: http://golang.org/doc/effective_go.html#errors

@btc
Copy link

btc commented Apr 10, 2014

In Go, functions can return multiple values. Generally it's good to return errors to the caller like so:

fileName, err := generateTempFile()
if err != nil {
  // handle error
}
examine(filename) // proceed; no error

@otiai10
Copy link
Owner Author

otiai10 commented Apr 13, 2014

@0xbtc Thanks so much! I'll tackle those problems in #12

otiai10 added a commit that referenced this pull request Apr 13, 2014
@otiai10 otiai10 merged commit 7906d26 into master Apr 13, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants