Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

In the function signature, the return variable err is type error. Since it is named it is also defined and initialized as nil.

In the code, an error is found and it does not assign a value to err and just returns it as the error value.

So it returns nil as the error when it wants to return an error with a proper value.

The code should be something like:

    if ctx.Err() != nil {
      return 0, 0, ctx.Err()
    }


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: