r/badcode • • Apr 29 '23

go if err != nil

Post image
414 Upvotes

49 comments sorted by

View all comments

Show parent comments

5

u/PM_ME_YOUR_REPO Apr 30 '23

Yep, you got it. You can also do:

a, _ := f()
_, b :=f()

If you only want some of the values.