Go Anti-Patterns : os.IsExist(err) != !os.IsNotExist(err)
This article was first published 3 years ago as a gist. os.IsExist(err) != !os.IsNotExist(err) An old Golang anti-pattern is to mis-use the functions os.IsExist(err) and os.IsNotExist(err), thinking that they are the opposite of each other. But that couldn’t be further from the truth. They are error checkers, so use them only when err != nil, […]