You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: notify.go
    path of file: ./repos/rclone/lib/systemd
    
    the code of the file until where you have to start completion: package systemd

import (
	"fmt"
	"log"
	"sync"

	"github.com/coreos/go-systemd/v22/daemon"
	"github.com/rclone/rclone/lib/atexit"
)

// Notify systemd that the service is starting. This returns a
// function
    
func Notify() func() {
	if _, err := daemon.SdNotify(false, daemon.SdNotifyReady); err != nil {
		log.Printf("failed to notify ready to systemd: %v", err)
	}
	var finaliseOnce sync.Once
	finalise := func() {
		finaliseOnce.Do(func() {
			if _, err := daemon.SdNotify(false, daemon.SdNotifyStopping); err != nil {
				log.Printf("failed to notify stopping to systemd: %v", err)
			}
		})
	}
	finaliseHandle := atexit.Register(finalise)
	return func() {
		atexit.Unregister(finaliseHandle)
		finalise()
	}
}