Starting the Notify Package
Learn how to create the notify package and set up the environment for it.
We'll cover the following...
We'll cover the following...
Unlike other applications we developed, notify
won’t be an executable application. It will be a library that allows us to include system notifications in other applications. We’ll develop a naive but functional implementation that
uses the os/exec
package to call external programs that send a system notification. Because notifications vary according to the operating system, this is
a practical example of how to use operating system–specific data and files in
our applications.
Updating the notify.go
file
Let’s update the file notify.go
. We add the package
definition and the import section.
For this file, we’ll use:
- The package
runtime
to check the running operating system. - The