I really enjoy developing system application, web application and microservices using Golang. Usually, I create a systemd service entry for my Golang applications to make automatically start my application during boot-up and for ease of operation (start, stop, restart). I hope my simple systemd script can help someone whom might need it.
# Systemd unit file for example application [Unit] Description=Service Description After=syslog.target network.target [Service] Type=simple Restart=always RestartSec=30s User=user Group=group WorkingDirectory=/path/to/working-directory ExecStart=/path/to/working-directory./golang-application [Install] WantedBy=multi-user.target