Created
February 14, 2022 20:11
-
-
Save jcdan3/046bc382a9a9a36fe58df1d977afb7a0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package notifier | |
import "fmt" | |
type notifier struct { | |
name string | |
id int | |
counter int | |
} | |
func (n *notifier) notifyUser() { | |
fmt.Println("Receiving user notification from " + n.name) | |
} | |
func (n *notifier) Notify() { | |
n.counter += 1 | |
if n.name != ""{ | |
n.notifyUser() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment