mirror of
https://github.com/teivah/100-go-mistakes.git
synced 2026-06-22 09:27:16 +08:00
21 lines
286 B
Go
21 lines
286 B
Go
package main
|
|
|
|
import "errors"
|
|
|
|
func listing1() {
|
|
// ...
|
|
|
|
notify()
|
|
}
|
|
|
|
func listing2() {
|
|
// ...
|
|
|
|
// Notifications are sent in best effort.
|
|
// Hence, it's accepted to miss some of them in case of errors.
|
|
_ = notify()
|
|
}
|
|
|
|
func notify() error {
|
|
return errors.New("failed to notify")
|
|
}
|