Mặc dù go có hỗ trợ trả về nhiều giá trị, nhưng theo anh em có nên code kiểu trả về nhiều giá trị không?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Theo em thì có, và tốt nhất là nên chỉ trả về tối đa 2 giá trị thôi
VD: func Abc() (*User, error)
À anh hiểu ý em, đúng nhỉ, vì ông go lang này không có exception, nên ông cần trả về nhiều giá trị bao gồm kết quả và error là hợp lý, cám ơn em.