Search
Write a publication
Pull to refresh
0
0
Андрей Базаров @RunSoFun

Go Software Engineer

Send message
func validateUser(id string) error {
    ...

    userInfo, err := db.GetUserInfo(id)
    if err != nil {
        return errors.As(err, &ErrUserInfo) // уточняем ошибку 
    }

    ...
}

Ошибка будет, так как errors.As(err, &ErrUserInfo) возвращает true|false.

Information

Rating
11,645-th
Location
Новосибирск, Новосибирская обл., Россия
Date of birth
Registered
Activity

Specialization

Backend Developer
Senior
Web development
Golang
PostgreSQL