Answer the question
In order to leave comments, you need to log in
Why has the behavior of if changed?
func ErrKeyNotExists() error {
return errors.New("key not exists")
}
if ErrKeyNotExists() == ErrKeyNotExists() {
log.Println("ok")
} else {
log.Println("err")
}
q := 1
w := 1
if &q == &w {
log.Println("ok")
} else {
log.Println("err")
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question